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

Controlling sounds with Scripts

Status
Not open for further replies.

pxpDesigner

Technical User
Apr 23, 2004
2
US
Hello,

I have created a flash movie that consists of 2 frames and is controlled by a very extensive bit of script. This is a game demo and there are over 50 scenarios that can occur. Each one is mapped out in the script and flash executes a different set of commands for each outcome. What I would like to do is attach a sound clip to each scenario so that a different sound will play depending on what is happening on screen. I tried attaching a do...while statement to each case telling flash to play sound in each case but during tests, I received an error message saying that the script was causing Flash player to become unresponsive. Same thing happened when I used an if statement. Can I assign variable names to sound clips and use scripts to call up these sounds as a result of a particular occurence on screen? Better yet, can Flash play a random sound clip from a set of sounds as a result of screen actions? Any help is greatly appreciated. Thank you!
 
What would these sounds be? Short loops? Are you familiar with soundObjects? Would you want to preload all of these sounds, or stream them on demand?
 
The sounds are AIFF files that are on average about 5-6 seconds long. They are set up as loops that play until a button is pressed and the screen resets. I used a stopAllSounds command to get them to stop but I can't get them to start. I am not familiar with soundObjects but I have read about them a little on this forum. Is that a way to classify sound clips so that they can be called up later with an event?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top