Actionscript 3:MovieClip 控件
您好,我有一个从朋友那里得到的 SWF 剪辑。代码如下所示:
[Embed(source="assets/gorilla_run.swf", mimeType="application/octet-stream")]private var gorillaRun:Class;
public var loader:Loader = new Loader();
private var movie:MovieClip= new MovieClip;
loader.loadBytes(new gorillaRun());
movie.addChild(loader);
stage.addChild(movie);
我想访问该影片剪辑的帧,以便可以控制其动作。该 SWF 有很多帧,但是当我使用此命令时:
跟踪(电影.totalframes);
我得到“1”作为我的输出。
Hello I have a SWF clip that I got from a friend. the code looks like this:
[Embed(source="assets/gorilla_run.swf", mimeType="application/octet-stream")]private var gorillaRun:Class;
public var loader:Loader = new Loader();
private var movie:MovieClip= new MovieClip;
loader.loadBytes(new gorillaRun());
movie.addChild(loader);
stage.addChild(movie);
I would like to access the frames of this movieclip so that I can control its action. There are many frames to this SWF however when I use this command:
trace(movie.totalframes);
I get "1" as my output.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将获得容器(
电影
)中的帧数。当您制作此movie.addChild(loader);
时,您不会将时间线从gorilla_run.swf
插入到movie
中。如果你想获得农场总数,请尝试以下操作:You get number of frames in the container (
movie
). When you make thismovie.addChild(loader);
, you do not insert timeline fromgorilla_run.swf
to themovie
. If you want to get total farmes try this: