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

Search adobe-integrated-runtime

July 04, 2009

<<   <   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 30 31   

Home /  Groups /  Adobe Integrated Runtime (AIR)

FileStream readObject with JS based AIR app

  << Previous Post |  RSS |  Subscribe to this Group Next >> 

FileStream.readObject with JS based AIR app

I'm trying to open a text file, and read it's contents with a JS based AIR app. Andy Matthews 03/17/2008 12:34 AM

03/17/2008 12:34 AM
Author: Andy Matthews Short Link: http://www.houseoffusion.com/groups/adobe-integrated-runtime/thread.cfm/threadid:1619#5102 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?
<< Previous Thread Today's Threads Next Thread >>

Mailing Lists