简体   繁体   English

Flash CC html5 canvas播放动画

[英]Flash CC html5 canvas playback animation

I'm trying to make a playback animation with flash cc and html5 canvas 我正在尝试使用Flash CC和HTML5 Canvas制作播放动画

So when I use something like 所以当我使用类似

this.gotoAndPlay(200);

works great in forward linear animation scenario, but what if I want to go from frame 200 to frame 0, playback the animation, or play the animation backwards, is this possible? 在正向线性动画场景中效果很好,但是如果我想从第200帧转到第0帧,回放动画或向后播放动画,这可能吗?

Any help would be much appreciated. 任何帮助将非常感激。

Thanks 谢谢

This is one simple example: 这是一个简单的示例:

var maxframe = 104
this.gotoAndStop(maxframe)

this.addEventListener('tick', playReverse.bind(this));


function playReverse()
{
        maxframe--;
        this.gotoAndStop(maxframe)
}

This will go to frame 104 and then go back to frame 0. Of course frame number check should be added, etc ... but you get the idea. 这将转到第104帧,然后返回到第0帧。当然应该添加帧号检查,依此类推……但是您明白了。

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

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