views:

34

answers:

1

I have added a button in flash I want this button to save a mp3 file from the server when a user clicks on it inside a browser.

One way to do this is:

import flash.net.FileReference;
import flash.utils.ByteArray;

var fileReference:FileReference = new FileReference();

var data:ByteArray; // load up your data into this ByteArray

fileReference.save(data, "outputfile.dat");

But how do we load a mp3 file from server in variable 'data'?

A: 

Just found FileReference.download() on google

Niraj Nawanit