Im attempting to load a mini mp3 player into a site and when you select the first song everything seems to work fine but when you select the second song it just starts the first song over from the beginning. here is the part of the code that is giving me the problem.
function songlistChange(e:Event):void{
sc.stop();
if(!isPlaying){
var song:String = new String(songlist_mc.selectedItem.data);
var loadsong:URLRequest = new URLRequest(song);
music.load(loadsong);
music.addEventListener(ProgressEvent.PROGRESS, musicProgress);
trace(song);
playfromlist();
}
else{
var music:Sound = new Sound();
var song:String = new String(songlist_mc.selectedItem.data);
var loadsong:URLRequest = new URLRequest(song);
music.load(loadsong);
music.addEventListener(ProgressEvent.PROGRESS, musicProgress);
trace(song);
playfromlist();
}
}
if anyone can help thank you!