Actually i dont have any idea how to make sounds work with movieclips, and how to control them via AS(AS2), so please give me all the resources tutorial and help you can about using sounds and controlling them via code.
In this case however i need to play a small sound on hitTest with a movieclip, how do i do that exactly?
Offtopic: what will be a good place to get some roalty free sounds for background music and effects?
Now right-click on it, select Linkage, check the Export for AS2/AS3 option and type in your Linkage Name
Go back to your stage, select a frame and right-click for Actions
Type in this code:
var btnsound = new Sound();
btnsound.attachSound(“yoursoundslinkagename”)
Now, if you want to play this sound when the user rolls over a button do this:
on(rollOver) {
_root.btnsound.start(0,1)
}
This is play the sound once. If you want to loop the sound, just change the 1 into how many times you want looped. Obviously, you can change the rollOver option for almost anything. Hope this helps
PS: Flashkit.com or Sounddogs have really good sound banks.
If you don’t want to have it exported in the first frame (crap for preloader) uncheck that checkbox in linkage and have it play on a intermediary unused frame as “event”
on(rollOver) {
_root.btnsound.start(0,1)
}
Try to avoid using Actionscript 1 and _root though
All problems are solver thanks to both of you!!..now, a bit of topic, i need some sound effects, can you please help me search for it?
telephone ringing-- "tring trrring"
Slob — as if a wet cloth struck something
And a dissolving sound when changing scenes.—“shooosh”
I have a background sound that i want to play throughout the game, but i want to lower its volume during the gameplay. I got it to work this far…but then,when i try to set the volume of my bullet sound bullet.setVolume(20); the background sound also gets set to 20…how can i change only one sound’s volume?