0 Replies Latest reply on Jan 14, 2011 6:04 AM by capitainequebec

    FileStream problem with AIR deployment

    capitainequebec Level 1

      I use FileStream to load local XML file. When I test the desktop application directly from Flex everything is ok but when I install it with AIR, the application work but the file is not loaded. Here is the code I use:

       

      import flash.filesystem.*;

       

       

      var applicationDirectoryPath:File = File.applicationDirectory;

       

      var nativePathToApplicationDirectory:String = applicationDirectoryPath.nativePath.toString();

       

      nativePathToApplicationDirectory +=

      "/config_poste_temps.xml";

       

      var file:File = new File(nativePathToApplicationDirectory);

       

       

      var fs:FileStream = new FileStream();

       

      fs.open(file, FileMode.READ);

       

       

      var config:XML = XML(fs.readUTFBytes(fs.bytesAvailable));

       

      fs.close();

       

      plan.text = config.division;

       

      Regards