AS2 - rewind timeline

Out of context: Reply #2

  • Started
  • Last post
  • 5 Responses
  • fyoucher10

    MC Tween frameTo function might be the easiest solution for you if you're a noob to AS2.

    http://hosted.zeh.com.br/mctween…

    There's also other tweening engines that'll do the same thing (Tweener, Greensocks TweenMax, etc etc). However, this one is probably the easiest to implement for you.

    Download the AS file and put it next to your FLA.
    In the frame where you have your code, insert the following:
    #include "mc_tween.as"
    (or whatever the AS file is called)

    Then use code like this to do what you want. It'll basically be simulating a video scrubber with the timeline

    myButton.onPress = function(): Void {
    anim_mc.play();
    }
    myButton.onRelease = function(): Void {
    anim_mc.frameTo(1, 1, "linear");

    The parameters for the frameTo function are as follows:
    1st parameter is the frame number you want to go to.
    2nd parameter is the duration you want the playhead to take to get back to that frame
    3rd is the kind of easing you want to use.

    Check out the site for more detailed documentation.
    }

    • whoops one of the end brackets in that code got pushed to the very end of the post...fyoucher1

View thread