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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating onSoundComplete method 1

Status
Not open for further replies.

lopez27889

Technical User
Oct 20, 2003
1
US
I'm trying to create an educational software showcase for elementary teachers. My theme is space related with an astronaut sounds object as the intro. When the user rolls over the planets, another sound file will begin to explain what the user will encounter if they visit that planet - simulations for example.

What I'm encountering is the astronaut will still be talking if the user rolls over a planet. Then I have two sound files overlapping.

I'm just a beginner/intermediate user with Flash. I've searched for possible solutions, but am having a hard time figuring out the code.

Please help!!
 
Aren't you really talking about control over several independent sound objects simultaneously?

If so, you should use soundObjects and have a look at this tutorial...


Regards,

cubalibre2.gif
 
assuming that you only want the other sounds to be playable once the intro is over and that thereafter only one sound can play at a time then something like this ought to be ok

intro = new sound();
intro.loadSound("talk.mp3",true);
intro.start();
intro.onsoundComplete = allOver;
done = false;
function allOver(){
done = true;
}
mars.onRollOver = function(){
if(done){
done = false;
s1 = new sound();
s1 = loadSound("mars.mp3",true)
s1.start()
s1.onSoundComplete = allOver;
}
}
venus.onRollOver = function(){
if(done){
done = false;
s2 = new sound();
s2 = loadSound("venus.mp3",true)
s2.start()
s2.onSoundComplete = allOver;
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top