AS3嵌入swf元件库,如何访问指定的资源
2013-05-11 23:07
375 查看
It’s been a long-time without a post. Part of the reason for that has been starting work at a new job (which involves a commute), and part has been that as part of my new job, I was actually encouraged to spend time playing World of Warcraft. To me, that’s
like taking a crowbar to Pandora’s Box and having a peek inside. I learned quite a lot, but have also played just a few too many Warsong Gulches.
Back to work, and I was doing a little prototyping this evening, when I came across a familiar problem: In
to embed a symbol from an art
looks like it should do the trick, but you can’t access any of the information within the asset. That’s a real pain, the reason for which is pretty convoluted. I remembered working around this problem in the past, and happily managed to unearth a long-forgotten
treasure in my codebase, which I thought I’d share (having rapidly refactored it to use as3-signals, naturally).
When you embed a SWF in this way then instantiate it, Flash somehow conspires to create a
转自:http://alecmce.com/as3/embed-asset-gotcha
参考:https://github.com/login?return_to=%2Frobertpenner%2Fas3-signals
like taking a crowbar to Pandora’s Box and having a peek inside. I learned quite a lot, but have also played just a few too many Warsong Gulches.
Back to work, and I was doing a little prototyping this evening, when I came across a familiar problem: In
AS3we can use
SWFin what is probably a code-built
SWF. That’s great, but what if you want to embed an entire
SWF?
treasure in my codebase, which I thought I’d share (having rapidly refactored it to use as3-signals, naturally).
MovieClipAssetwith a
Loaderinside, which will be ‘loading’ the already-embedded content. The content is not available immediately (it may be sometimes, I have encountered cases where it was not), so you have to wait for an
Event.COMPLETEto be fired before you can access it. This class exposes a signal that informs you when the content is ready. It could probably be more rigorous, such as including an
isCompleteflag, but it serves my purposes, when used in the following manner:
参考:https://github.com/login?return_to=%2Frobertpenner%2Fas3-signals
相关文章推荐
- 如何在AS3中引用swf中的元件、图片等资源以及布局信息
- 如何在AS3中引用swf中的元件、图片等资源以及布局信息
- 如何嵌入和使用 C# 来访问资源
- abp 如何设置和访问嵌入资源(视图、css、js等)
- AS3加载外部swf资源库中的元件(MovieClip)
- AS3如何外部加载swf,并使用其中的元件或者类
- 如何嵌入并使用 C# 来访问资源
- 如何限制指定用户、指定IP访问特定服务器?
- 【dotnet跨平台】如何启用远程访问asp.net mvc 5网站并指定端口?
- 未能找到任何适合于指定的区域性或非特定区域性的资源。请确保在编译时已将“定型测试.Frm.resources”正确嵌入或链接到程序集“定型测试”,或者确保所有需要的附属程序集都可加载并已进行了完全签名
- Linux下iptables 禁止端口和开放端口(仅供参考,里面含有iptables如何指定允许外网访问的端口号范围,以及对局域网的ip全部开放端口)
- (转)flex, swf 不能访问网络/本地资源
- 如何解决ORA-00054资源正忙,要求指定NOWAIT
- Nginx如何设置拒绝或允许指定ip访问
- 解决flashDevelop发布的swf访问本地资源报错
- abp 嵌入资源(视图、css、js)的访问
- 4.1 Android如何访问资源
- 摆放元件时候,如何精确的将元件的某个管脚放在指定的坐标上
- tomcat如何访问非webapp下的资源文件
- URL如何通过Proxy代理访问Internet资源