有没有办法向 Swiffy 添加一个 JavaScript 侦听器,以检测动画何时完成?(在 SWF 转换为 Swiffy 之前不编辑 FLA)
在 AS3 中,我使用了加载 SWF。JS中是否有这样的东西:
private function loadAnimationCompleteListener():void {
//add listener for when animation is complete
animation.addEventListener(Event.ENTER_FRAME, isAnimationComplete);
}
//tell me when the intro animation is complete
private function isAnimationComplete (e:Event):void {
if (e.target.currentFrame == e.target.totalFrames) {
//do something here
//remove listener
animation.removeEventListener(Event.ENTER_FRAME, isAnimationComplete);
}
}