#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    1
    Rep Power
    0

    Question How to Restart MovieClip in a Main Timeline?


    Hi AS3 Guys,

    I need help with my flash work regarding the looping animation.

    --------------------------------------------------------------------------------------------------------------------
    Problem Case: I have Main Timeline which is a looping animation, within the Main Timeline there is movieclip named "MC" ( inside the movieclip timeline, I put stop(); so that the movieclip will not play automatically within the main timeline and wait for the animation to be finished ), but the problem is when the 2nd iteration of animation, the movie clip stops and doesnt restart its animation.
    Note:
    The total length of animation is 11secs @ 18FPS with a total of 199Frames
    The movieclip is a only part of the main animation that had own animation itself.
    I need AS3 code.

    Question: How do I restart the movieclip animation in every iteration/loop of the main timeline animation. What am I going to do?
    --------------------------------------------------------------------------------------------------------------------

    I tried some sample on the internet but no one works for me. Any answer would be great help. Thanks!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2008
    Posts
    60
    Rep Power
    7
    It would probably be better to add an instance of the movieclip when you need it, and remove when you don't anymore, but that might be a bit much right now, so try this on you 2nd iteration:

    Code:
    MC.gotoAndPlay(1);
    Attached Files
    Last edited by stillwell; June 21st, 2012 at 09:23 PM.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    4
    Rep Power
    0
    restartScene();
    - restarts a stopped scene.

    Example:
    RunPseudoScenes();

    MovieClip.prototype.restartScene = function(){
    _root.scene.onEnterFrame = _root.scene.onEnterFrameBAK;
    };
    MovieClip.prototype.gotoAndPlayScene = function(label, frame){
    _root.scene.gotoAndStop(label);
    _root.scene.getScene();
    if (frame == undefined) frame = 1;
    _root.scene.currScene.gotoAndPlay(frame);
    if (!_root.scene.onEnterFrame) _root.scene.onEnterFrame = _root.scene.onEnterFrameBAK;
    };
  6. #4
  7. No Profile Picture
    Gotta get to the next screen..
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2003
    Location
    Legion of Dynamic Discord
    Posts
    6,678
    Rep Power
    3164
    YEAV, that's ActionScript 2
    Quis custodiet ipsos custodes?

IMN logo majestic logo threadwatch logo seochat tools logo