Open local files in AS3

How to open a file and get its contents as ByteArray in AS3. I saw examples using the FileStream and File classes from flex.filesystem, but the document only talks about this for AIR.

Thanks,

Nava

+3
source share
4 answers

You can try URLLoader with content for binary, or use a URLStream . What do you need to download?

+3
source

You can use the FileReference object to search for a file, and then access the raw bytes through the "data" property on the FileReference when a "full" event is dispatched.

+4

Flex .

The most commonly used workaround is the user selecting a file, sending it to your server, and downloading the file from your server.

For storage and reading, access to local storage is available (using SharedObject).

Hth,

Koen

+2
source

A new feature in Flash 10. The last time you cannot 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/

+2
source

Source: https://habr.com/ru/post/1716560/


All Articles