【发布时间】:2012-05-11 03:50:05
【问题描述】:
我有一个由 3 个独立符号组成的影片剪辑。其中 2 个符号的 alpha 补间超过 60 帧。 1 个符号根本没有补间。所有符号都位于单独的图层中,并且在第 60 帧上有一个带有关键帧的第 4 个空图层,用于操作脚本。
第 60 帧的动作脚本只是“stop();” .
我正在从文档类中动态地将影片剪辑的实例添加到舞台。当我有“stop();”在那里,影片剪辑出现在舞台上并直接跳到第 60 帧,并成功停止。
没有“stop();”在那里,movieclip 完美地播放了 alpha 补间,但显然是连续循环的。
手动调度 Event.COMPLETE 并监听它也不起作用,我也不希望那样做。
以下是将影片剪辑添加到舞台的代码:
//initialize the gameplay, remove title screen.
private function initialize_gameplay():void
{
//remove the title screen
initialize_title_screen(true);
this.screen_transition_obj = new tide_out_video();
this.addChild(this.screen_transition_obj);
this.game_board = new tidepool_gameboard();
this.screen_transition_obj.addEventListener(Event.COMPLETE,swap_transition_video_for_screen);
}
//replace the current transition video with the screen it was transitioning to
private function swap_transition_video_for_screen(e:Event){
this.addChild(this.game_board);
if(this.screen_transition_obj != null){
if(this.getChildByName(this.screen_transition_obj.name)){
this.removeChild(this.screen_transition_obj);
}
this.screen_transition_obj.removeEventListener(Event.COMPLETE, swap_transition_video_for_screen);
this.screen_transition_obj = null;
}
}
movieclip 的类是 tidepool_gameboard,存储对它的引用的文档类的属性是 game_board。
知道为什么将 stop(); 放在影片剪辑的第 60 帧会导致它跳到结尾而不进行补间吗?
更新:
立即将影片剪辑添加到舞台而不是作为事件侦听器的结果正常工作,只有在事件侦听器中添加影片剪辑时才会出现问题。
【问题讨论】:
-
您可能需要上传一个重现此问题的小 .fla。没有时间线就很难检查与时间线相关的问题。时间线可能有问题,您忽略了并且没有包含在您的描述中。
-
@xxbbcc 我一直在尝试在一个较小的演示 FLA 文件中重新创建问题。我似乎无法重现它,但问题仍然存在于完整文件中。我会上传它,但它非常大而且不方便......即使是精简后的演示也是 15MB - 一切都是 1080p 并且有几十张图像构成了这个符号。
标签: actionscript-3 flash actionscript flash-cs5