简体   繁体   English

在AS3中使用SWF发布外部资源

[英]Publish External Resources with SWF in AS3

有没有办法在开发时从外部加载图形,但在发布时将图形打包到项目的swf中?

There's definitely no built-in way of doing that. 绝对没有内置的方法可以做到这一点。 You could build a class that handles supplying assets to your views. 您可以构建一个类来处理为视图提供资产的过程。 The class would be smart enough to be able to alternatively instantiate objects either from a library asset or an externally-loaded asset. 该类足够聪明,能够从库资产或外部加载的资产中实例化对象。 That way, all you would need to have is a toggle that will determine if the assets are loaded externally or not. 这样,您只需要一个切换即可确定资产是否从外部加载。 If the toggle is set to external, then your application will know to preload the assets. 如果切换设置为外部,则您的应用程序将知道预加载资产。 Either way, your custom asset class will know how to instantiate each object you need. 无论哪种方式,您的自定义资产类都将知道如何实例化所需的每个对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM