|
-
File download / URLRequest
Hi,
I'm trying to create a button that downloads an mp3 file and saves it to a users computer ie. you click the button and the standard windows box appears asking where you want to save the file.
I've tried the code below but the file opens and starts playing as opposed to asking the user where to save it. Am I on the right lines for achieving this?
Thanks for any pointers.
Robin
btn.addEventListener(MouseEvent.CLICK, myButtonFunction);
function myButtonFunction(event: MouseEvent)
{
var request:URLRequest = new URLRequest("test.mp3");
navigateToURL(request, "_blank");
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|