Embedding XML in Flex
Here's an example of embedding an XML file, then tracing out data at compile time via actionscript.
The best part is the the XML is compiled into the swf, and you can access any of the XML file's properties by accessing it via the singleton XML Manager.
[Embed(source="myXMLFile.xml",mimeType="application/octet-stream")] public static const XMLFILE:Class; public static const MY_XML : XML = setConst(); private var cache : Object ; public var dataXML : XML; private static function setConst():XML { var ba:ByteArray = new XMLFILE() as ByteArray; trace("compiling"); return new XML(ba.readUTFBytes(ba.length)); } private static var model : XMLManager; public static function getInstance() : XMLManager { if ( model == null ) { model = new XMLManager(); } return model; } public function XMLManager() { if ( model != null ) { throw new Error( "Only one XML Manager instance should be instantiated" ); } dataXML = MY_XML; cache = new Object(); }