Flash - 反向播放影片剪辑? [英] Flash - Play movie clip in reverse?
本文介绍了Flash - 反向播放影片剪辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我从影片剪辑中退出时,我试图让影片剪辑反向播放(它在 mouse_over 上播放).
I'm trying to get a movie clip to play in reverse when I mouse_out from it (it plays on mouse_over).
我的动作脚本如下:
mc.stop();
mc.addEventListener(MouseEvent.MOUSE_OVER,mover);
mc.addEventListener(MouseEvent.MOUSE_OUT,mout);
function mover(e:MouseEvent):void
{
mc.play();
}
function mout(e:MouseEvent):void
{
//Play in reverse
}
我将如何实现这一目标?
How would I achieve this?
谢谢
推荐答案
最好的方法是使用 ENTER_FRAME 事件侦听器.基本上这就是你想要做的
The best way would be to use an ENTER_FRAME event listener. Basically this is what you want to do
function mover(e:MouseEvent):void {
stopPlayReverse();
mc.play();
}
function mout(e:MouseEvent):void {
this.addEventListener(Event.ENTER_FRAME, playReverse, false, 0, true);
}
function playReverse(e:Event):void {
if (mc.currentFrame == 1) {
stopPlayReverse();
} else {
mc.prevFrame();
}
}
function stopPlayReverse():void {
if (this.hasEventListener(Event.ENTER_FRAME)) {
this.removeEventListener(Event.ENTER_FRAME, playReverse);
}
}
这将反向播放您的 MovieClip 直到它到达第 1 帧,然后它会停止.
This would play your MovieClip in reverse until it hits frame 1, then it will stop.
这篇关于Flash - 反向播放影片剪辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文