The Little Guy
08-13-2009, 05:12 AM
For some reason, I can only run this method one time:
public function loadSong(file:String){
var request:URLRequest = new URLRequest("http://www.dudeel.com/process/flash/getAudio.php?file="+file);
soundFactory.addEventListener(Event.COMPLETE, completeHandler);
soundFactory.addEventListener(Event.ID3, id3Handler);
soundFactory.addEventListener(IOErrorEvent.IO_ERRO R, ioErrorHandler);
soundFactory.addEventListener(ProgressEvent.PROGRE SS, progressHandler);
soundFactory.load(request);
song = soundFactory.play();
}
When I try to run it a second time, I get the following error:
Error: Error #2037: Functions called in incorrect sequence, or earlier call was unsuccessful.
at flash.media::Sound/_load()
at flash.media::Sound/load()
at Audio/loadSong()
at Audio/onTxtClick()
What is the reason for that?
public function loadSong(file:String){
var request:URLRequest = new URLRequest("http://www.dudeel.com/process/flash/getAudio.php?file="+file);
soundFactory.addEventListener(Event.COMPLETE, completeHandler);
soundFactory.addEventListener(Event.ID3, id3Handler);
soundFactory.addEventListener(IOErrorEvent.IO_ERRO R, ioErrorHandler);
soundFactory.addEventListener(ProgressEvent.PROGRE SS, progressHandler);
soundFactory.load(request);
song = soundFactory.play();
}
When I try to run it a second time, I get the following error:
Error: Error #2037: Functions called in incorrect sequence, or earlier call was unsuccessful.
at flash.media::Sound/_load()
at flash.media::Sound/load()
at Audio/loadSong()
at Audio/onTxtClick()
What is the reason for that?