Flash Scrollbars
There are several approaches on how to add scrollbars into a Flash file. Here I am introducing 3 of them:
A) SCROLLBAR COMPONENT FOR DYNAMIC TEXT FIELD
Quick to implement but requires advanced level of ActionScript knowledge.
The advantage is that the scrollbar component can be customized to match your design - include its parts in your library and change the symbols as you like. For more information please read 'About skinning components' document found in Flash help database.
Preview in new window >
Download the source code >
B) SCROLLBAR NO. 2: PRESS AND HOLD
This version of scrollbar is very easy to use and customize.
Two buttons on the timeline have been used so that scrolling continues when a arrow is pressed.
Preview in new window >
Download the source code >
C) SCROLLBAR NO. 3: CLICK TO SCROLL
The simplest version of a scrollbar. Text is placed directly into a dynamic field and 'scroll' attribute is used to move the text up and down.
Preview in new window >
Download the source code >
How it works
First you need to assign the scrollbar component from your library to the dynamic text field: this.createClassObject(mx.controls.
UIScrollBar, "my_sb", 20);
Three lines of ActionScript follow to set some scrollbar parameters.
Finally you load a external txt file into the text field:loadit_lv.load("myText.txt");
How it works
The arrow buttons rely on 3 parameters which you can set in the 'actions' layer:
startingY: Starting position of the text movie clip
h: Height of the display area
speed: Scroll speed
Additional ActionScript has been used for each arrow to move the text up or down. Also, it is necessary to test position of the text so that it doesn't run away from the screen.
How it works
The arrow buttons set 'scroll' attribute of a dynamic text field. For example, to scroll up this line of code has been used:
develop_txt.scroll -= 2;
