Embedding XML at compile time : ByteArray : Development Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Development » ByteArray »

 

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(  ));
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Development
» ByteArray