Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dropdown song changer

Status
Not open for further replies.

brainpudding

Technical User
Sep 29, 2002
84
0
0
US
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);
};
 
Did you get this from kenny's?

You didn't quite mention the problem... And why don't you post your .fla? You could strip it from it's mp3s (to make it smaller, althoug you seem to be loading them dynamically...), but then we'd might better understand the problem, adding our own test tracks, but at least seeing the whole .fla.

Regards,

cubalibre2.gif
 
Does the music play at all or will it play and just not loop.

I noticed that your code loads music dynamically but you are you are trying to loop it. As far as I am aware you cannot loop sound like this.

Just my 2c worth.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top