on (release) {
import flash.net.FileReference;
var listener:Object = new Object ();
listener.onSelect = function (file:FileReference):Void {
if (file.type != ".mp3" && file.type != ".wav") {
trace ("File must be mp3 or wav");
this._parent.songSelect.text = "File must be .mp3 or .wav";
} else {
trace ("Opened a " + file.type + " called " + file.name);
_root.filename = file.name;
_root.loadOwnFile = true;
}
};
listener.onCancel = function (file:FileReference):Void {
trace ("User cancelled");
};
var fileRef:FileReference = new FileReference ();
fileRef.addListener (listener);
fileRef.browse ();
}
This loads a file, but it dont do anything with it. What i want it do, is that i either can get the adress, like C://Documents/song.mp3, or upload the song in flash so that i can load it using loadSound