brainpudding
Technical User
ok this is what im trying to do .. I want to have a pull down where the user can select something from the list. and when they do that particular song plays. the pulldown is located _root.soundPane.songs songs is the instance name of the pull down and here is the code .. can anyone tell me whats wrong?
_root.soundPane.songs.setChangeHandler("songChange"
;
function songChange() {
bgsound.stop();
music = _root.soundPane.songs.getSelectedItem().data;
bgsound = new Sound();
bgsound.loadSound("music/"+music+".mp3", true);
bgsound.start(0, 999);
playing = true;
bgsound.setVolume(100);
}
bgsound.onSoundComplete = function() {
bgsound.start(0, 999);
};
_root.soundPane.btn_play.onPress = function() {
this.gotoAndStop(3);
trace("OK"
;
if (_root.playing != true) {
_root.bgsound.start(0, 999);
_root.playing = true;
}
};
_root.soundPane.btn_play.onRelease = function() {
this.gotoAndStop(1);
};
_root.soundPane.btn_stop.onPress = function() {
this.gotoAndStop(3);
_root.bgsound.stop();
_root.playing = false;
};
_root.soundPane.btn_stop.onRelease = function() {
this.gotoAndStop(1);
};
_root.soundPane.songs.setChangeHandler("songChange"
function songChange() {
bgsound.stop();
music = _root.soundPane.songs.getSelectedItem().data;
bgsound = new Sound();
bgsound.loadSound("music/"+music+".mp3", true);
bgsound.start(0, 999);
playing = true;
bgsound.setVolume(100);
}
bgsound.onSoundComplete = function() {
bgsound.start(0, 999);
};
_root.soundPane.btn_play.onPress = function() {
this.gotoAndStop(3);
trace("OK"
if (_root.playing != true) {
_root.bgsound.start(0, 999);
_root.playing = true;
}
};
_root.soundPane.btn_play.onRelease = function() {
this.gotoAndStop(1);
};
_root.soundPane.btn_stop.onPress = function() {
this.gotoAndStop(3);
_root.bgsound.stop();
_root.playing = false;
};
_root.soundPane.btn_stop.onRelease = function() {
this.gotoAndStop(1);
};