topical media & game development

talk show tell print

actionscript-embed-EmbedXML.ax

actionscript-embed-EmbedXML.ax [swf] flex


  package {
    import flash.display.*;
    import flash.events.*;
    import flash.utils.ByteArray;
  
    public class @ax-actionscript-embed-EmbedXML extends Sprite {
      [Embed(source="ctionscript-embed-embeds-data.xml", mimeType="application/octet-stream")]
      private var BinaryData:Class;
  
      public function @ax-actionscript-embed-EmbedXML () {
        // Create a new instance of the embedded data
        var byteArray:ByteArray = new BinaryData();
        
        // Convert the data instance to XML
        var data:XML = new XML(byteArray.readUTFBytes(byteArray.length));
        
        // Display the source code for the embedded XML
        trace(data.toXMLString());
      }
    }
  }
  


(C) Æliens 27/08/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.