Hands-On: Flash MX 2004 the Basics
Exercise 5: Using Dynamic Scrolling Text Blocks
- Open the file at the bottom called dynamicScrollText.fla(This
page is intentionally colored gray because the buttons are white, so don’t
fret.)
- Change the name of Layer 1 to Text.
- On the Stage draw a text area box approximately 250px by 200px.
- Change the text style to Dynamic Text and in the Instance Name
box directly below type the name myText.

Change
the line field to Multiple.
- With the Arrow selection tool, click inside of the text area box you
have on the Stage, right-button click and choose Scrollable.
- Copy a large selection of a .TXT file to paste inside of the text
area box. (Note: if your box stretched to accommodate your pasted text, you forgot
to turn the text area box to scrollable, in step 4.)
- In the Timeline create a new layer above the text layer and
call it buttons. Click in the first frame of this button layer.
- From the Library [F11] attached to this practice file is one Down
Button, drag it to the Stage and place it at the bottom right of the
text area box.
- Click once on the new button and open the Actions panel [F9].
Choose the following steps: Click the Plus Mark + and then select
Global Functions > Movie Clip Control > double-click on and
then choose Release

- Click to the right of the curly bracket} in the code area
and then hit the [Enter] key.
- Choose the following steps:
Click the Plus Mark + and then select
Built-in Classes > Movie > TextField > Properties > scroll
 
- To the right of the word scroll hit the [Space Bar]
and type a Plus Sign + and then an Equals Sign = hit the [Space
Bar] again and then type a 1 and a semi-colon ;
This bit of code tells the button to stay where it is on the screen but every
time you hit the down button scroll down one line of text. If you wished to scroll
more than one line at a time, type a different number, such as 5, which would
scroll 5 lines for each click of the button.
- Back on the Stage, hold down the [Shift] key and the [Alt]
key together, and then drag a copy of the Down Button with it’s
ActionScript already made to the top of the text area box.
- Click off the button anywhere on the Stage (in case both are still selected),
and then click back on just the Button placed at the top. Choose Modify > Transform > Flip
Vertical to turn the arrow facing upwards.
- While
still on the new Up button, hit [F9] to open the Actions panel,
notice that the ActionScript is still there, but you have to change only one
thing, the Plus Sign + now needs to be a Minus Sign – so
the text can scroll back up. That’s it! If you project looks like the one
shown below, you did it right. The red arrow is showing because I was pressing
it as I took the screen shot.
You can download these two files to create this Hands-On Exercise:
http://profal2.com/cis127/pdf/assets/basicHTML/placeholder.txt
http://profal2.com/cis127/pdf/assets/flash/dynamicScrollText.fla
|