


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”.
#How to use macromedia flash mx 2004 movie
With the laser movie clip selected inside it, add the following onClipEvent(load) event handler, above the onClipEvent(enterFrame) handler: Next, we need to create a new Sound object and attach the sound to it.You’re doing the same thing you did when attaching a movie clip-giving the sound an identifier you can use to attach the sound in the movie. Right-click on the sound, select Linkage, and, in the Linkage dialog, give the sound a unique linkage ID.If necessary, import the sound you’re going to use to the library.
#How to use macromedia flash mx 2004 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.
