|
我们可以通过下面的方法将XML也作为资源嵌入进SWF中 - package example
- {
- import mx.core.ByteArrayAsset;
- public final class Config
- {
- [Embed("config.xml", mimeType="application/octet-stream")]
- private static const Config:Class;
- public static function getConfig() : XML
- {
- var ba:ByteArrayAsset = ByteArrayAsset( new Config()) ;
- var xml:XML = new XML( ba.readUTFBytes( ba.length ) );
- return xml;
- }
- }
- }
复制代码
|