Actionscript 3:MovieClip 控件

发布于 2024-12-28 09:08:31 字数 475 浏览 3 评论 0原文

您好,我有一个从朋友那里得到的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

往日情怀 2025-01-04 09:08:31

您将获得容器(电影)中的帧数。当您制作此 movie.addChild(loader); 时,您不会将时间线从 gorilla_run.swf 插入到 movie 中。如果你想获得农场总数,请尝试以下操作:

trace(MovieClip(loader.contentLoaderInfo.content).totalFrames);

You get number of frames in the container (movie). When you make this movie.addChild(loader);, you do not insert timeline from gorilla_run.swf to the movie. If you want to get total farmes try this:

trace(MovieClip(loader.contentLoaderInfo.content).totalFrames);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文