Flex SWFLoader Event.COMPLETE 未触发

发布于 2024-08-03 06:14:24 字数 283 浏览 1 评论 0原文

尝试将位图加载到 SWFLoader 时,不会触发 Event.COMPLETE 事件,

mySWFLoader.source = new Bitmap(Bitmap(someEvent.content).bitmapData);

但如果我使用 URL 作为源,则会触发完整事件:

mySWFLoader.source = "http://example.com/123.jpg";

使用位图作为源时是否有某种限制?

While trying to load a Bitmap onto a SWFLoader the Event.COMPLETE event is not being triggered

mySWFLoader.source = new Bitmap(Bitmap(someEvent.content).bitmapData);

but if I use a URL as source the complete event is triggered:

mySWFLoader.source = "http://example.com/123.jpg";

Is there some kind of restriction while using Bitmap as source?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

转身泪倾城 2024-08-10 06:14:24

我相信,如果您使用内存中已存在的数据(您的位图将如此),则不会发生加载操作。施工后应立即使用。我知道在 AS2 中附加电影就是这样的。如果它是库的一部分,您可以立即使用它,并且不会发生加载事件。

I believe if you use data that already exists in memory (which your Bitmap would) then no load operation would happen. It should be usable immediately after construction. I know attaching movies in AS2 worked like that. If it was part of the library you could use it right away and no loading events would happen.

眼中杀气 2024-08-10 06:14:24

Use

mySWFLoader.addEventListener(Event.ADDED,handleSwfLoadComplete);

It 在实际创建内容并将其添加到显示列表时触发。

我遇到了同样的问题。问题是,当您使用 Bitmap 或 Class 作为源时,只有在实例化 Bitmap 或 Class 后才会填充内容。

这发生在 swfLoader.loadContent 中,它最终将新创建的内容作为加载器的子项添加到 displayList 中,并最终调度 ADDED 事件。

Use

mySWFLoader.addEventListener(Event.ADDED,handleSwfLoadComplete);

It fires when the content is actually created and added to the display list.

I encountered the same issue. The problem is that when you use Bitmap or Class as source, the content is populated only after the Bitmap or class was instantiated.

This happens in swfLoader.loadContent which eventually adds the newly created content to the displayList as the loader's child, and eventually dispatches the ADDED event.

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