Tutorials Home
What's New
Top Rated
Submit
myTutes
Random!
Sound With ActionScript
Author: EnSanity
| Website: www.iremota.com |
Heig,
Just real simple, but something that is very useful to know, for reusability purposes or for whatever you may think of.
Steps
- Import a sound into your library.
- Right click the sound and select linkage then check, Export for actionscripting and Export in first frame
- Then in your first frame put
s = new Sound();//declare s as a sound
s.attachSound("buttonSound");//attach the linked sound 'buttonSound' to s
myButton.onRollOver=function(){// make a function
s.stop();//and just so we dont get
//that aweful looping over one sound, we will stop
//it before we start it again.
s.start();//starts the sound
}
This creates a sound object 's' and puts your sound file named 'buttonSound' into 's'. Then creates a function so that when you roll over the button it plays the sound, pretty straight
| » Level Intermediate |
|
|
Added: : 2003-03-25
Rating: 4.44 Votes: 42
Hits: 2314
|
| » Author |
|
designer of iremota
|
| » Download |
|
Download the files used in this tutorial.
|
|
Download (0 kb)
|
|
Get conversion and unzipping tools
for PC and Mac here!
|
| » Forums |
|
More help? Search our boards for quick answers!
|
|
Please rate this tutorial, 10 is the top rating, you can also click the
comments link to read/write a review.
|
|
|