Hi,
How do i open file and get its content as a ByteArray in AS3. I saw examples, using FileStream & File classes from flex.filesystem, but the doc says it's for AIR only.
Thanks,
Nava
Hi,
How do i open file and get its content as a ByteArray in AS3. I saw examples, using FileStream & File classes from flex.filesystem, but the doc says it's for AIR only.
Thanks,
Nava
You can try either URLLoader with content set for binary, or use URLStream. What do you need to load ?
Flex security prevents simple access to local files.
The most commonly used workaround is having the user select a file, send that to your server, and then downloading that file from your server.
There is access to some local storage (using SharedObject) for storing and reading settings.
hth,
Koen
You can use a FileReference object to browse for a file and then access the raw bytes via the "data" property on the FileReference when the "complete" event is dispatched.
New feature in Flash 10. Last time you can't read the file directly. But now, you can. http://www.mikechambers.com/blog/2008/08/20/reading-and-writing-local-files-in-flash-player-10/