Flex SWFLoader Event.COMPLETE 未触发
尝试将位图加载到 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信,如果您使用内存中已存在的数据(您的位图将如此),则不会发生加载操作。施工后应立即使用。我知道在 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.
Use
It 在实际创建内容并将其添加到显示列表时触发。
我遇到了同样的问题。问题是,当您使用 Bitmap 或 Class 作为源时,只有在实例化 Bitmap 或 Class 后才会填充内容。
这发生在 swfLoader.loadContent 中,它最终将新创建的内容作为加载器的子项添加到
displayList
中,并最终调度 ADDED 事件。Use
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 theBitmap or class
was instantiated.This happens in
swfLoader.loadContent
which eventually adds the newly created content to thedisplayList
as the loader's child, and eventually dispatches the ADDED event.