
The only argument is the linkage ID of the library sound being attached. Notice that the attachSound method is very similar to the attachMovie method of the MovieClip object.

The second line attaches a specific sound-”laser_fire”-from the library to the laserSound object. We can then use “laserSound” to access the properties and methods of the Sound object. The first line simply creates a new Sound object called “laserSound”.

#Flash mx 2004 action script movie
With the laser movie clip selected inside it, add the following onClipEvent(load) event handler, above the onClipEvent(enterFrame) handler:
#Flash mx 2004 action script how to
To give you a simple idea of how to use the Sound object, we’ll load a laser sound into our laser movie clip, so whenever the user fires the gun, it makes a shot-like sound: Like any object, it has built-in methods that you can use for loading a sound, removing the sound when it’s no longer needed, applying sound transforms, and controlling the volume and offset of sound output (panning). If you’ve ever added sound to frames in a movie, you probably know that you can use them to control playback you can’t do that using the Sound object, but the Sound object does provide some advantages.
