Reputation: 5074
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.
Upvotes: 0
Views: 618
Reputation: 637
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!
Upvotes: 1
Reputation: 5074
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
Upvotes: 0