This is code i used for saving pictures to user computer on button click:
Code:
// Create a new instance of the FileReference class to work with.
var myfileReference:FileReference = new FileReference();
// Create a new URLRequest object specifying the location or URL of the download file.
// URL
// var myRequest:URLRequest = new URLRequest("htp://ww.flashwonderland.com/index.html");
// relative location
var myRequest:URLRequest = new URLRequest("htp://ww.mywebsite.com/picture.png");
function downloadFile (event:MouseEvent):void {
// Call the download method with the URLRequest object as the parameter.
myfileReference.download(myRequest);
}
// Hook up the button with the function downloadFile
goBTN.addEventListener(MouseEvent.CLICK, downloadFile);
On goBTN (button) click it shows saving window at the same time.
Can showing window be delayd for 3 second?