Monday, March 24, 2008

Open the File

I have made a bit more progress with the text editor. I have a browse button in the application to open an existing text file for editing. I have the dialog open up, and limit the user to only open *.txt documents, then have the application open a file stream and read its contents. For binary data, this is done using

var stream = new air.FileStream();
stream.open( file, air.FileMode.READ );
stream.readBytes( header, 0, 0 );
stream.close();


However I need to read flat ASCII files, not binary files, and this is handled differently in javascript and AIR. I am still searching for a good reference book that outlines the AIRAliases script as well as the AIR document object model (DOM).

No comments: