闪存AS3 - 等待影片剪辑完成 [英] Flash AS3 - Wait for MovieClip to complete

查看:141
本文介绍了闪存AS3 - 等待影片剪辑完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写一些code,它(我认为)需要顺序播放MovieClip对象。 我希望能够在一个单一的框架离开这一点,并只使用外部源文件。

I'm writing some code that (I think) requires sequentially playing MovieClip objects. I would like to be able to leave this at a single frame and using only external source files.

我希望用这种方式是我的程序段之间进行切换。

The way I wish to use this is to switch between sections of my program.

删除当前子
构建影片剪辑
添加新的子
等待新的孩子,转到下一步

remove current child
construct movieclip
add new child
wait for completion of new child and goto next step

这是posisble?

Is this posisble?

编辑:除了ENTER_FRAME方法。运行处理每一帧似乎浪费在剪辑时达到其最后一帧的信号肯定会被发送。

Other than the ENTER_FRAME method. Running a handler every frame seems wasteful when a signal surely could be sent when the clip reaches its final frame.

推荐答案

您可以使用 addFrameScript 方法。

<一个href="http://www.kirupa.com/forum/showpost.php?p=2098268&postcount=318">http://www.kirupa.com/forum/showpost.php?p=2098268&postcount=318

MovieClip.addFrameScript(frame:int, method:Function, [frame:int, method:Function...]):void;

事情是这样的:

Something like this :

// This will be called on the last frame.
function myfunc():void{
    // Do stuff
}
// ** The frame number is zero-based.
myclip.addFrameScript(myclip.totalFrames-1, myfunc);

这篇关于闪存AS3 - 等待影片剪辑完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆