简体   繁体   中英

Replay button in flash cs5.5

I have inserted my replay button into my flash movie and it works.

The problem is when I replay my movie some aspects of my animation do not work in the replay.

I believe this is because I have other timelines for movement eg birds wings.

How do i implement code so that the entire movie will replay?

If your project is mostly animation and little to no code, you can place all of the animation into a MovieClip . Export this symbol for ActionScript, giving it the class name Animation .

Your replay button could simply remove the current instance of your animation and then re-attach it (which should reset the entire content).

Sample:

var animation:Animation;

replay.addEventListener(MouseEvent.CLICK _replay);
function _replay(e:MouseEvent = null):void
{
    if(animation != null)

        if(animation.parent)
            animation.parent.removeChild(animation);
    }

    animation = new Animation();

    addChild(animation);
}

_replay();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM