PDA

View Full Version : Download a file in AS3


kindoki
10-10-2007, 11:45 AM
Hi guys,

I'm trying to do a very simple thing. To create a button that when pressed, a file is downloaded, a zip file for example. How do I do this in AS3??

I'm building an application using AIR, so I must use AS3... Browsers won't be used.

Thank you very much

Kin

Daedalus
10-10-2007, 01:05 PM
The FileReference class is used to handle downloads

You are probably looking for this class>

http://livedocs.adobe.com/flex/2/langref/flash/net/FileReference.html

you can learn how to use it here>

http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/js/html/wwhelp.htm?href=00001936.html

hope this helps.

You should be able to use it in AIR as flash.net.FileReference is not just limited to flex.