actionscript3 addFrameScript 有什么意义 [英] actionscript3 whats the point of addFrameScript

查看:26
本文介绍了actionscript3 addFrameScript 有什么意义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问一下 addFrameScript.

I want to ask about addFrameScript.

addFrameScript(0, frame1);   

这个脚本是什么意思?为什么是 0?

what is this script means? why its 0?

是否可以将 0 替换为其他数字或单词?

is it possible to replace 0 with other number or word?

public function try()
{
    addFrameScript(0, frame1);
    return;

}// end function

如果有人能帮我理解?

推荐答案

这个未公开的方法用于在 MovieClip 实例播放头到达给定帧时调用函数,在这种情况下是第 1 帧,0(基于 0 的索引).您当然受限于可用的帧数;例如,要在最后一帧添加脚本,您可以使用:

This undocumented method is used to invoke a function when a MovieClip instance playhead reaches the given frame, in that case the 1st frame, 0 (0-based index). Your are of course limited to the available number of frames ; for instance, to add a script you the last frame, you would use :

mc.addFrameScript(mc.totalFrames-1, lastFrameReached);

function lastFrameReached():void {
    trace("stopping the animation");
    mc.stop();
}

只需将其视为 Flash 创作工具中带有一些代码的框架即可.

Just think of it as a frame with some code inside the Flash authoring tool.

这篇关于actionscript3 addFrameScript 有什么意义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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