mp3 player help

Hi guys, i’m having a few problems with a mp3 player i’m trying to make. the player is being designed to be embeded into profile pages for a ‘bebo-esc’ website. The problem i’m having is that users might not have all 5 songs present in their folder, so i need to be able to skip to the next song if ones missing. currently i’m trying to use a ‘try catch’ statement (it’ve made the specific area quite obvious) but for some reason it’s not working. if the file isn’t there it throws an error instead of moving onto the next entry in the playlist array and trying again…
i was mostly wondering if i’m just barking up the wrong tree i guess?
any help on this matter is highly apprechiated
Ads


stop();
var home = this;
var User = "jim"; //points to a directory, would normaly be passed in by the page the 
//player is embeded in
 
if (User != undefined) {
 playlist = new Array();
 playlist[0] = User+"/song1.mp3";
 playlist[1] = User+"/song2.mp3";
 playlist[2] = User+"/song3.mp3";
 playlist[3] = User+"/song4.mp3";
 playlist[4] = User+"/song5.mp3";
 starter();
} else {
 home.display_txt.text = "User variable failed to pass";
}
 
function starter() {
 home.createEmptyMovieClip("sound_mc", 1);
 home.sound_mc.sound_obj = new Sound();
 _global.song_nr = 0;
 songStarter(playlist[song_nr]);
}
 
function songStarter(file) {
 
 
//---------------------------------------------//
 
 
 try {
  home.sound_mc.sound_obj.loadSound(file, true);
 } catch (e) {
  if (_global.song_nr == playlist.length-1) {
   _global.song_nr = 0;
  } else {
   _global.song_nr++;
  }
  songStarter(playlist[song_nr]);
 }
 
//---------------------------------------------------//
 
 
 home.sound_mc.onEnterFrame = function() {
  if (home.sound_mc.sound_obj.position>0) {
   delete home.sound_mc.onEnterFrame;
   home.display_txt.text = home.sound_mc.sound_obj.id3.artist+": "+home.sound_mc.sound_obj.id3.title;
  } else {
   home.display_txt.text = "didn't work";
  }
 };
 home.sound_mc.sound_obj.onSoundComplete = function() {
  trace("song finished");
  if (song_nr == playlist.length-1) {
   _global.song_nr = 0;
  } else {
   _global.song_nr++;
  }
  songStarter(playlist[song_nr]);
 };
}