adobe air gotoandstop 不起作用
我有这样的问题:
我有一些影片剪辑,上面有两个不同的子项:“instruction”和“back_anim”。它们具有相同的结构,除了一件事:“指令”具有经典补间,“back_anim”具有“补间形状”。我在 Android 版 Adobe Air 2.6 上运行它。每个孩子身上都有两个标签:“显示”、“隐藏”。所有停止帧都存在。我有这样的代码来控制它们:
protected function fadeOut(event:Event):void {
line_mc.removeEventListener(Event.COMPLETE,fadeOut);
if (line_mc.hasOwnProperty('back_mask_anim')){
line_final_anim_count++;
(line_mc['back_mask_anim'] as MovieClip).addEventListener(Event.ENTER_FRAME, checkFinalAnimComplete);
(line_mc['back_mask_anim'] as MovieClip).gotoAndPlay("show");//show
}
if (line_mc.hasOwnProperty('instruction')){
line_final_anim_count++;
(line_mc['instruction'] as MovieClip).addEventListener(Event.ENTER_FRAME, checkFinalAnimComplete);
(line_mc['instruction'] as MovieClip).gotoAndPlay('hide');
}
if(line_final_anim_count == 0){
setTimeout(lineComplete,time_before_fade_out);
}
}
protected function checkFinalAnimComplete(event:Event):void {
var anim_mc:MovieClip = event.currentTarget as MovieClip;
trace("anim_mc.frame " + anim_mc.currentFrame + " of " +anim_mc.totalFrames +
"name = " + anim_mc.name);
if(anim_mc.currentFrame == anim_mc.totalFrames) {
anim_mc.removeEventListener(Event.ENTER_FRAME, checkFinalAnimComplete);
line_final_anim_count--;
}
trace("line_final_anim_count: " + line_final_anim_count);
if(line_final_anim_count == 0){
lineComplete();
}
}
但是!!! “指令” - 播放良好,“back_anim” - 在停止帧上进入无限循环。 当我这样做时: (line_mc['back_mask_anim'] as MovieClip).gotoAndPlay(7);停止帧后的下一帧 - 一切正常。怎么了?有人面临这样的问题吗?谢谢。
I have such a problem:
I have some movie clip with two different childs on it: "instruction" and "back_anim". They have the same structure, except one thing: "instruction" have classic tween, "back_anim" have "shape tween". I'm running it on Adobe Air 2.6 for Android. On each of this childs are two labels: "show", "hide". All stop frames present. And I have such a code to controll them:
protected function fadeOut(event:Event):void {
line_mc.removeEventListener(Event.COMPLETE,fadeOut);
if (line_mc.hasOwnProperty('back_mask_anim')){
line_final_anim_count++;
(line_mc['back_mask_anim'] as MovieClip).addEventListener(Event.ENTER_FRAME, checkFinalAnimComplete);
(line_mc['back_mask_anim'] as MovieClip).gotoAndPlay("show");//show
}
if (line_mc.hasOwnProperty('instruction')){
line_final_anim_count++;
(line_mc['instruction'] as MovieClip).addEventListener(Event.ENTER_FRAME, checkFinalAnimComplete);
(line_mc['instruction'] as MovieClip).gotoAndPlay('hide');
}
if(line_final_anim_count == 0){
setTimeout(lineComplete,time_before_fade_out);
}
}
protected function checkFinalAnimComplete(event:Event):void {
var anim_mc:MovieClip = event.currentTarget as MovieClip;
trace("anim_mc.frame " + anim_mc.currentFrame + " of " +anim_mc.totalFrames +
"name = " + anim_mc.name);
if(anim_mc.currentFrame == anim_mc.totalFrames) {
anim_mc.removeEventListener(Event.ENTER_FRAME, checkFinalAnimComplete);
line_final_anim_count--;
}
trace("line_final_anim_count: " + line_final_anim_count);
if(line_final_anim_count == 0){
lineComplete();
}
}
but!!! "instruction" - plays well, "back_anim" - enters to endless cycle on stop frame.
When I do : (line_mc['back_mask_anim'] as MovieClip).gotoAndPlay(7); next frame after stop frame - all ok. Whats the matter? Anyone face with such problem? Thanx.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通过创建一个包含舞台中所有内容的影片剪辑解决了这个奇怪的问题,gotoandstop 函数似乎适用于影片剪辑,但不能直接适用于舞台。
希望我有帮助!
I resolved this weird issue by creating an movieclip with all things from stage the gotoandstop function seems to work with movieclips but not with the stage directly.
Hope I helped!
我解决这个问题。
也许有人会有所帮助。
http:// /www.kirupa.com/forum/showthread.php?335765-gotoAndPlay%28%29-and-frame-script-stop%28%29
I resolve this issue.
Maby someone it will help.
http://www.kirupa.com/forum/showthread.php?335765-gotoAndPlay%28%29-and-frame-script-stop%28%29