A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11303 Flash Movies | 7 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Nitin Tikhe
» Title: Cart
» Description: This Animation Tut is a fun and useful for kids below 15 years. Watch the Flag, Doors, Stick and Horse movements.
» More by Nitin Tikhe


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 6008 Flash Sites | 0 New Flash Links
What's New | Top 100 Flash Site

Featured Site

» Posted in the Flash Kit Links section
» Title: Banana Swimwear
» Description: This is a banana swim wear interactive catalog we designed and animated in Flash


Random Links | Add your own Flash Related Links
Flash Tutorials 1255 Tutorials 7 New Tutorials Added!
What's New | Top100

» Make flash video player for broadcasting live streaming video / TV on website
» How to convert the project file of Flash Demo Builder 2.0 into FLV file
» FLV to PSP for Mac - How to convert YouTube video to PSP on mac
» How to Convert FLV to MP4 for Playback on iPod
» how to download and convert youtube video to AVI with Leawo Free FLV converter
» Flash Multi-player Game Tutorial - TicTacToe
» How to make Flash elearning tutorials with screen recorder?
» Fader API:Slideshow with MovieClips on stage
» How to convert MS PPT file into an FLV File
» Unknown Tag: Title10
Random Tutorial | Add Site

Network Design Manager
The Computer Merchant, Ltd
US-VA-Hampton

Justtechjobs.com Post A Job | Post A Resume


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Categories Making an Info-Window with Scrolling Text
Author: Patrick Jansen | Website: http://orbita.starmedia.com/~pjv |

 
Page 8
«prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ... next»

Adding the scrollbuttons and nessary triggers.

Open Movie Clip scrollDown and create 3 empty keyframes. At frame 1, insert the action:

stop ();

At frame 2 insert the actions

currentScroll = _parent.windowtext.scroll;
max = _parent.windowtext.maxscroll;
if (currentScroll 

Let's look at what this does. First the variable currentScroll is set to the current scollvalue of scrolltext. It will return the number of the current topmost textline. Next, the variable max is set to the maximum textline which can show up as line 1 in the textfield scrolltext. For example, if your text is 40 lines and your textfield shows 7 lines, then max will result in a value of 33 (40 - 7) since when line 33 is shown as line 1 in the textfield, it will show the rest of the text till line 40. Next comes an If statement. We just want to scroll untill it reaches the maximum scroll, so we check if the current textline is less then the maximum scrollable textline. If it is less, the continuously executed action in frame 2 of the loop frame 2 - frame 3 will create a scrolling effect by getting the current scroll line and adding up 1 line, and we close the If statement.

To create a loop between frame 2 and 3, add the following action to frame 3

gotoAndPlay (2);

Now we'll repeat this for the Movie Clip scrollUp but with a little difference in the scrollaction. Frame 1, insert action:

stop ();

At frame 2 insert the actions

currentScroll = _parent.windowtext.scroll;
max = _parent.windowtext.maxscroll;
if (currentScroll> 1) {
 _parent.windowtext.scroll = currentScroll-1;
}

And in frame 3 the action

gotoAndPlay (2);

The difference with scrollDown is in the If-statent of scrollUp. Because the initial scrollvalue of a textfield is always 1, the first line of the textfield, we check that currentScroll (the current scroll value - read 'current visable first line number') is greater then 1. This way the text will scroll up only until it reaches the first line. This is done by the action between the If -statement, where we get the current scrollvalue of scrolltext and counting down 1 line.

Noticed the use of _parent ? If you are a little bit familiar with Action Script you probably get this right away. If you got confused, the _parent indicates one level lower in the hierarchy of flash movieclips and/or loaded movies. currentScroll and max are local variables within the trigger Movie Clips scrollUp and scrollDown. These 2 Movie Clips are placed in the Movie Clip textMC. scrolltext.scroll and scrolltext.maxscroll are properties of the textfield scrolltext which is directly situated in Movie Clip textMC. To addres properties from a Movie Clip with actions which reside within a nested Movie Clip, you need to use _parent before the variable.

Later we will need to add one more line of important Action Script to frame 2. This line will keep setting the position of the dragable scrollbar when the scroll up or down buttons is clicked and held.

«prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ... next»

» Level Intermediate

Added: : 2001-01-25
Rating: 8.23 Votes: 123
Hits: 6456
» Author
Patrick Jansen is a freelance flash-, graphic- and webdesigner. Born in Holland, currently residential in Brazil. Worked for the compagnies Lectric b.v. (www.lectric.nl) and NIC b.v. (www.notenbomer.nl).
» Download
Download the files used in this tutorial.
Download (138 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments