<A HREF="/Tech" TARGET="_self"><IMG SRC="../FlyingFonts/FT-Logo.gif" WIDTH=137 HEIGHT=70 BORDER=0></A>
Actionscript Plug and Play - Simple Scrolling Text

This Simple Scrolling Text Plug and Play routine provides a basic way to implement scrolling text in a Flash 4 movie. It is suitable for use with shorter messages. The smoothness and speed of the scrolling action will be slowed down when there is a large amount of text.

To use the Plug & Play Simple Scrolling Text movie clip.

1) Select and copy the ScrollMC movie clip or the frame it is in.
2) Open the movie you want to contain a scrolling Text Field.
3) Create a new empty layer in your movie.
4) Create and name a new layer and paste ScrollMC in it.
5) Add text to the variable ScrollText.

Where to put your text:

The text for ScrollMC is stored in the variable ScrollText on the main timeline. The scroll window will be empty if you don't create your own variable ScrollText (or copy the three Set Variable actions from frame 1 of the Text layer in our example). The variable ScrollText will include all the text used in the Scroll MC:

  Set Variable: "ScrollText" = "All your text."
Below we show how the text can be a composed of a combination of variables. We have created 2 variables to store our text, Text1 and Text2 then we combined them into the variable that our scroll gadget uses (ScrollText). You can create and combine text from as many variables and strings as you desire. Note, when setting a string to equal a variable or combination of strings (an expression), you need to set the Variable Type button from ABC (String Literal) to the equals sign (=) for Expression.
  Set Variable: "Text1" = "Put a paragraph of text here."
  Set Variable: "Text2" = "Put more text here."
  Set Variable: "ScrollText" = Text1 & chr(13) & chr(13) &  Text2

The three Set Variable actions are placed in frame 1 of a layer named Text on the main timeline. The third action takes the contents of Text1, two chr(13) strings and the contents of Text2 and combines them into a single longer string. The & (ampersand) is the operator that is used to concatenate strings of letters in Flash. A chr(13) tells Flash to add a new line; it acts as a Return does in a word processor.

<A HREF="/Tech" TARGET="_self"><IMG SRC="../FlyingFonts/FT-Logo.gif" WIDTH=137 HEIGHT=70 BORDER=0></A>
Download FLA in Zip format

How to format the font:

The text formatting is set in the Scroll MC movie clip. Select the text field on the layer labeled Text Field to select the font and its style and size.

Graphic frame and background for scrolling text:

The scrolling text and the background are on the layer named Text Container. You can double click on either and edit these symbols ( "platform" or "background for text" ) to change them to fit your design needs. Note, the background for text is not strictly neccessary. Hint- click once to select an item you wish to redesign and then chose edit in place to more easily size and style your new graphic.

To change the graphics for the buttons double click on the button and substiute the graphic you want to use for the existing artwork.

How it works:

The up and down scroll buttons activate script contained in 2 invisible movie clips ScrollUp and ScrollDown (these are in the layer labeled Scroll Control) . The actions in the ScrollDown MC are shown below:

  Set Variable: "CurrentLine" = ..:ScrollText.scroll
  If (CurrentLine < ..:ScrollText.maxscroll)
        Set Variable: "..:ScrollText.scroll" = CurrentLine + 1
  End If
The first line checks the current scroll line and places it in the variable CurrentLine. Then if CurrentLine is less than number of lines in the scroll window (whether seen or not) then the topmost line displayed in the scroll window will be increased by 1 and the text will move up one line

 

last updated 11/15/99 JC