ActionScript2:Controlling a Scrolling text box

From virtualMV2015wiki
Revision as of 17:13, 14 January 2015 by Hesperides (Talk | contribs) (1 revision imported)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 Home  Flash10 (CS4), Flash11 (CS5) <


Unfortunately, The UIScrollBox does not appear to consistently work. So here is an alternative way to control a scrolling text box.

Scrolling Text box using buttons and ActionScript2

Icon Objective.png


By the end of this exercises you should be able to:

  • Add some buttons and use ActionScript 2 to control the scrolling


1. Create a scrolling text box (as shown in the Text scroll box example but don't add the UIScrollBar ). For the Text box make the instance Name TextScroll.

2. Add an up button and a down button (Adding buttons)

3. To the up button add

on (press) {TextScroll.scroll -= 1;

4. To the down button add

on (press) {TextScroll.scroll += 1;

Icon Example.png



1. Change the ActionScript to on (rollOver). What happens?

2. Can you get the scrolling text box so that when you rollover a button it continues to scroll? -- if you have a solution put it here and I will add an answer page :)

3. Can you implement a solution where the scrolling occurs relative to the position in the scroll box (i.e. Stops in the middle, goes up faster as you move to the top, and down faster as you move to the bottom. -- if you have a solution put it here and I will add an answer page :)

Icon References.png References

ActionScript2:Controlling a Scrolling text box. (2017). In virtualMV's ( Michael Verhaart ) wiki. Retrieved December 12, 2017, from    (zotero)