A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: text scroller

  1. #1
    Junior Member
    Join Date
    Jun 2001
    Posts
    4
    What is the script to make a text scroller?
    I've tried a few, anyone know one?

  2. #2
    "variable.scroll" and "variable.maxscroll" are the extension commands for text fields in Flash. ".scroll" is the line number of the top line in your text field and ".maxscroll" is the maximum line of your text field. An example use of the code would be in a situation where you have two buttons (ScrollUp and ScrollDown), you have a text field (text). To get the text to scroll up and down while the user presses and holds down, create a 3 frame MC for each (scrolling up and scrolling down). In the first frame put a Stop command. In frame 2, place the following:


    ScrollUpMC (frame 2):
    Set Variable: "textScroll" = /:text.scroll
    If (textScroll > 1)
    Set Variable: "/:text.scroll" = textScroll - 1
    End If

    ScrollDownMC:
    Set Variable: "textScroll" = /:text.scroll
    If (textScroll < /:text.maxscroll)
    Set Variable: "/:text.scroll" = textScroll + 1
    End If

    On the Buttons, place the following code:

    Scroll Up Button:
    On (Press)
    Begin Tell Target ("/scrollUpMC")
    Go to and Play (2)
    End Tell Target
    End On
    On (Release)
    Begin Tell Target ("/scrollUpMC")
    Go to and Stop (1)
    End Tell Target
    End On

    Scroll Down Button:
    On (Press)
    Begin Tell Target ("scrollDownMC")
    Go to and Play (2)
    End Tell Target
    End On
    On (Release)
    Begin Tell Target ("/scrollDownMC")
    Go to and Stop (1)
    End Tell Target
    End On

    I can't remember where I first saw this code presented. If I can find the reference, I will repost the credit. It may have been on Flashzone a few years back. If someone recognizes, please chime in.

    Cheers,
    Markus B

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center