A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: how do you control scrolling speed?

  1. #1
    Member
    Join Date
    Apr 2000
    Posts
    76
    i downloaded one of the movies off this site to get an example of cursor controlled scrolling...and it works pretty well ...except i'm not a very proficient action scripter and i need help in learning how to control the speed of the scroll.

    the further left or right you move the cursor....the faster the scrolling...i don't want it to speed up.

    how do i fix this??????

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    128
    Well you would have to post the code you are using but somewhere in there is acceleration scripting, probably involving 2 variables. If you chop out that code and one of the variables you should get a scroller that moves at a steady speed.

    Or, an example:

    ::BUTTON CODE

    On (press)
    Tell target ("/controller")
    Go to and play ("scroll_left")
    End tell target
    End on
    On (release, rollover)
    Tell target ("/controller")
    Go to and stop ("stop")
    End Tell target
    End on

    ::CONTROLLER IS A MOVIE CLIP WITH NOTHING IN IT
    ::YOU WOULD OF COURSE REPEAT THIS CODE ON YOUR "RIGHT" BUTTON, WITH THE GO TO AND PLAY CHANGED ACCORDINGLY

    ::CONTROLLER HAS 5 FRAMES, LABELED:

    stop, scroll_left, scroll_left_loop, scroll_right, scroll_right_loop

    ::The "stop" frame has nothing but a stop command.
    ::The "scroll_left" frame looks like this:

    Set Variable "location" = GetProperty("/thing_that_should_scroll,_x)
    Set Property ("/mc_that_should_scroll") = location - 10

    ::The scroll_left_loop frame is simply

    Go to and play ("scroll_left")

    ::repeat this for the _right frames, reversing the math.

    And there you have it, a two-button-based, non-accelerating simple scroller for a single movie clip. You could easily recode it to add in acceleration or control for multiple MCs later. I didn't actually test this, so if for any reason it doesn't work let me know.

  3. #3
    Hack
    Join Date
    Mar 2000
    Location
    Madison, WI
    Posts
    1,753
    Try emailing the author of the movie -- he would know better thank anyone else how to modify his own script.

    em

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