I’ve been having some trouble with the coding on this, I know I’m doing a little thing wrong with thsi but I can’t figure it out. I want it to play a song (from a URL) by selecting it in a listbox.
I made a listbox and named it “songs”
//randomize
x = Math.round((Math.random()) * 4)
songs.setSelectedIndex(x);
music = new Sound(this);
y = getSelectedIndex();
if(y==0){
songurl="http://www.haxorl33t.com/mp3/trust.mp3";
}
if(y==1){
songurl="http://www.haxorl33t.com/mp3/glory.mp3";
}
if(y==2){
songurl="http://www.haxorl33t.com/mp3/risen.mp3";
}
if(y==3){
songurl="http://www.haxorl33t.com/mp3/rules.mp3";
}
if(y==4){
songurl="http://www.haxorl33t.com/mp3/waste.mp3";
}
music.loadSound(songurl,true);
any help is much appreciated, thanks…