Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author: Nick Kouvaris
»  Title: Znax
»  Description: Znax is a board game. Click 4 tiles of the same color and form squares as big as you can. You will erase all the tiles inside the square and collect points. Get maximum score if you make a square with game edges.
»  More by: Nick Kouvaris


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

Featured Site

»  Author Agence WOP Digital Agency
»  Title: Electricdrum
»  Description: French WOP Agency, 3D websites, Flash (Papervision, Away 3D), event or institutional projects. The agency operates on all digital projects: consulting, design, graphic design, development, online communication. The WOP agency follows you on the implementation of original, creative and optimized digital projects.


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

» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» How To Make A Fathers Day Slideshow
» How To Make A Transparent Background of Your Flash File
» Create Flash Banner With Text Disco Light Effect Today we will introduce you a Text Disco Light eff
» Unknown Tag: Title10
Random Tutorial | Add Site


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: 6461
» 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