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


Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0