as3 - 在“资产”中重用加载的图像; swf 无法控制加载“main”; swf
这是一个解释起来比较复杂的问题,请耐心等待。
我有一个main.swf,我无法控制也无法重新编译。它从 skin.swf 加载皮肤,其中包含要在 main.swf 中使用的所有影片剪辑和 gfx。
在 main.swf 被锁定后,我们决定 skin.swf 也应该能够加载图像作为背景以在某个影片剪辑中使用。
到目前为止效果很好 - main.swf 加载 skin.swf 并使用 frontscreen movieclip 加载 background.png
现在,我被要求在 skin.swf 中的其他影片剪辑中使用 background.png,但我不知道如何将其公开给他们使用。
一个糟糕的解决方案是每次都加载它,就像我目前在 frontscreen movieclip 中所做的那样,但这显然是不行的。或者,我考虑过将其动态附加到 main.swf 但我不太明白这一点。
任何有关这个复杂混乱的帮助将不胜感激!
This is a relatively convoluted problem to explain so please bear with me.
I have a main.swf which I cannot control nor recompile. It loads a skin from skin.swf which contains all the movie clips and gfx to be used within main.swf.
After main.swf being locked down it was decided that skin.swf should also be able to load an image as a background to be used in one of the movie clips.
This works fine so far - main.swf loads skin.swf and uses frontscreen movieclip which loads background.png
Now I have been asked to use the background.png in other movie clips within skin.swf and I cant figure out how to expose it to them for use.
A terrible solution would be to load it in each time as I currently do in frontscreen movieclip but that is obviously a no no. Alternatively I have considered dynamically ataching it to the main.swf but I can't quite figure this out.
Any help on this convoluted mess would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我理解正确的话,您正在使用
Loader
加载一些图像。内容是位图,您可以在舞台上的一处使用它。现在您需要一份副本吗?如果是这样,从BitmapData
字节加载它,速度很快。If I understand you correctly, you are loading some image with
Loader
. Content isBitmap
which you can use on stage in one place. Now you need a copy? If so, load it from bytes ofBitmapData
, it is fast.