Embedding XML at compile time
package {
import flash.display.*;
import flash.events.*;
import flash.utils.ByteArray;
public class EmbedXML extends Sprite {
[Embed(source="embeds/data.xml", mimeType="application/octet-stream")]
private var BinaryData:Class;
public function EmbedXML ( ) {
var byteArray:ByteArray = new BinaryData( );
var data:XML = new XML(byteArray.readUTFBytes(byteArray.length));
trace(data.toXMLString( ));
}
}
}
Related examples in the same category