A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Anyway to make the timeline go back?

  1. #1
    Senior Member
    Join Date
    Jan 2006
    Posts
    102

    Anyway to make the timeline go back?

    I wanna make a scene that when you press a button, it will make the animation reproduce backwards while the button is pressed.
    Is this possible or is it just madness??? lol

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    place the animation in a movieclip and control the clip timeline,
    file attached,

    hth

  3. #3
    Senior Member
    Join Date
    Jan 2006
    Posts
    102
    Hey thanx a_modified_dog! Exactly what i wanted to know. Just i found a new problem! :/ I wanted the animation to stop and only move when i either push a button to make it play normally, or a button for it to playbackwards.
    On the example you game me the animation is constantly playing.
    Thanx 4 the help.

  4. #4
    Senior Member
    Join Date
    Jan 2006
    Posts
    102
    Can anyone give me a hand on this one? I'm kinda stuck here.

  5. #5
    Senior Member
    Join Date
    Oct 2004
    Posts
    2,049
    is this something your looking for?

    this is in flash 8

  6. #6
    Senior Member
    Join Date
    Jan 2006
    Posts
    102
    Quote Originally Posted by wattsup
    is this something your looking for?

    this is in flash 8
    Well its also not exactly that. You see i want that when the mouse is on 1 button for it to play normally, and when it on rollover on another button it plays backwards. And when nothing is pressed the animation stops. I your wattsup i have to click on the buttons for it to move one frame, and all i want it to de is play not just skip a frame.

  7. #7
    Flasher
    Join Date
    Jun 2005
    Posts
    1,365
    Follow these steps:
    1.) Create a 2 new blank movie clip called "rewind1" and "play1". Drag it to your stage.
    2.) Give each movie clip the same instance name (ex: "play1"'s instance name should be "play1".
    3.) Create 2 buttons.
    4.) Drag them to your stage if you haven't already.
    5.) Edit the "play1" movie clip, and make 3 new keyframes.
    6.) Click on the first frame, and click F9. Enter in the following AS: "stop();".
    7.) Click frame 2, click F9. Enter in the following AS: "_root.play();".
    8.) Click on frame 3, click F9, enter in the following AS: "gotoAndPlay(2);"
    9.) Go back to the stage and edit the "rewind1" movie clip, and make 3 new keyframes.
    10.) Click on the first frame, and click F9. Enter in the following AS: "stop();".
    11.) Click frame 2, click F9. Enter in the following AS: "_root.prevFrame();".
    12.) Click on frame 3, click F9, enter in the following AS: "gotoAndPlay(2);"
    13.) Go back to the stage, and make a new layer. Name it "Actionscript".
    14.) Add a new keyframe, and enter the following AS: "stop();".
    15.) Add the following AS to each keyframe of that layer: "stop();"
    16.) Click the button you want to use to make the movie play and press F9.
    Enter the following AS:
    on (rollOver) {
    play1.Play(2);
    }
    on (rollOut) {
    play1.gotoAndStop(1);
    }
    17.) Click the button you want to use as the "rewind" button and press F9.
    Enter in the following AS:
    on (rollOver) {
    rewind1.gotoAndPlay(2);
    }
    on (rollOut) {
    rewind1.gotoAndStop(1);
    }
    There you go!
    -Sportzguy933
    Last edited by sportzguy933; 01-06-2007 at 05:58 PM.

  8. #8
    Senior Member
    Join Date
    Jan 2006
    Posts
    102
    Hey sportzguy933! Thanx for the help.
    ~I tried everything you said but it didnt work. The animation just stops on the first frame. As you can see on the attached file. Can you see whats the problem?
    Attached Files Attached Files

  9. #9
    Flasher
    Join Date
    Jun 2005
    Posts
    1,365
    Hey. I got it to work. Just change the script on your "Play" button to:
    on (rollOver) {
    play1.play();
    }
    on (rollOut) {
    play1.gotoAndStop(1);
    }
    Instead of
    on (rollOver) {
    play1.Play(2);
    }
    on (rollOut) {
    play1.gotoAndStop(1);
    }
    There shouldn't be a "2", and the "p" in "play();" shouldn't be capitalized ;-).

    ~Sportzguy933

  10. #10
    Member
    Join Date
    Mar 2004
    Location
    Los Angeles
    Posts
    44

    Tried your method and it does not work on embedded MC

    Hi Sportzguy933

    I have tried your script and it works perfectly on stage scenes only, it does not work at all on movie-clips that are placed on stage as an instance that are self contained entities. I am trying to control the timeline of an MC in reverse with a button embedded in it that will react the same way you have created it in your original script but functional for MCs that are place as instances on stage anywhere.

    I thank you in advance, I very much appreciate the help!

    I have attached the fla that I am using currently to test my result on.

    jas_G.
    Attached Files Attached Files

  11. #11
    Member
    Join Date
    Mar 2004
    Location
    Los Angeles
    Posts
    44

    I got it to work (embedded control of timeline with little scripting)

    I adjusted control MCs with labels and _parent protocol, I also made sure that the button control had absolute addresses. I was quit surprised that it worked. It is a good idea to walk away for a while and come back to the problem later, this always seems to work for me. After looking at other possibilities of scripting, I am grateful that it is so minimal and easy to follow. This makes it simple to control a timeline inside a placed instance MC on any other time line with all the components all in the same MC.

    I've attached the new version for all
    Attached Files Attached Files

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