0 Replies Latest reply on May 25, 2011 6:23 AM by Anakin1989

    ReadInt from file

    Anakin1989

      Hi,

      How can i read an int from a file? My application runs in Adobe Air. I tried using the sequence:

       

      var file:File=File.applicationDirectory;

      file=file.resolvePath(

      "world.txt");

       

      var fs:FileStream=new FileStream();

      fs.open(file,FileMode.READ);

      nr=fs.readInt();

       

      But it doesn't read the right numbers. The file looks something like:

      2 5

      1 2 3 4 5

      6 7 8 9 10

      But the program reads some really big numbers. I know i'm reading the right file because i used readUTFBytes(fs.bytesAvailable) and it shows what it should.

      I just want to read the numbers in sequence(first 2, then 5, then 1 and so on).

      Could you help me, please?

      Thank you.