简体   繁体   English

Flash CS5.5中的重播按钮

[英]Replay button in flash cs5.5

I have inserted my replay button into my flash movie and it works. 我已将重播按钮插入Flash电影中,并且可以使用。

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 . 如果您的项目主要是动画,几乎没有代码,则可以将所有动画放入MovieClip Export this symbol for ActionScript, giving it the class name Animation . 将该符号导出为ActionScript,为其赋予类名称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();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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