House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / Adobe Integrated Runtime (AIR)

FileStream readObject with JS based AIR app

Author:
Andy Matthews
03/17/2008 12:34 AM

I'm trying to open a text file, and read it's contents with a JS based AIR app. My code: var loginFileName = 'app.login'; var loginFile = air.File.applicationStorageDirectory.resolvePath(loginFileName); var _fs = new air.FileStream(); _fs.open(loginFile, air.FileMode.READ); var o = _fs.readObject(); As soon as it hits the readObject line it bombs with the following error: RangeError: Error #2006: The supplied index is out of bounds. at app:/scripts/Login.js : 33 I know that the file is there, and that it's open for read because I can swap out that line for this: var o = _fs.readUTFBytes(_fs.bytesAvailable); and it works just fine. Anyone have any ideas what's happening?


Search adobe-integrated-runtime

February 12, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29