1 Reply Latest reply on Oct 5, 2010 11:18 AM by tzeng

    Air App Storage

    rob day Adobe Community Professional & MVP

      I'm new to Air and am trying to open an xml file via a FileStream object. The xml file (site.xml) is in the same directory where the .swf gets published and I've also included it in Settings>Include Files, but this produces a file not found when I test:

       

       

      var filestream:FileStream=new FileStream();

      filestream.addEventListener(Event.COMPLETE, onOpen);

      filestream.openAsync(new File("app-storage:/site.xml"), FileMode.READ);

       

      private function onOpen(e:Event):void {

           xml=XML(filestream.readUTFBytes(filestream.bytesAvailable));

      }