adobe air gotoandstop 不起作用

发布于 2024-12-12 04:11:47 字数 1882 浏览 8 评论 0原文

我有这样的问题:

我有一些影片剪辑,上面有两个不同的子项:“instruction”和“back_anim”。它们具有相同的结构,除了一件事:“指令”具有经典补间,“back_anim”具有“补间形状”。我在 Android 版 Adob​​e 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

相对绾红妆 2024-12-19 04:11:47

我通过创建一个包含舞台中所有内容的影片剪辑解决了这个奇怪的问题,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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文