626
Chapter 12: ActionScript Dictionary
Example
The following example creates a new Sound object called
global_sound
. The second line calls
setVolume()
and adjusts the volume on all sounds in the movie to 50%.
global_sound = new Sound();
global_sound.setVolume(50);
The following example creates a new Sound object, passes it the target movie clip
my_mc
, and calls
the
start
method, which starts any sound in
my_mc
.
movie_sound = new Sound(
my_mc
);
movie_sound.start();
Sound.attachSound()
Availability
Flash Player 5.
Usage
my_sound
.attachSound("
idName
")
Parameters
idName
The identifier of an exported sound in the library. The identifier is located in the
Linkage Properties dialog box.
Returns
Nothing.
Description
Method; attaches the sound specified in the
idName
parameter to the specified Sound object. The
sound must be in the library of the current SWF file and specified for export in the Linkage
Properties dialog box. You must call
Sound.start()
to start playing the sound.
To make sure that the sound can be controlled from any scene in the SWF file, place the sound on
the main Timeline of the SWF file.
Sound.duration
Availability
Flash Player 6.
Usage
my_sound
.duration
Description
Property (read-only); the duration of a sound, in milliseconds.
Summary of Contents for FLASH MX 2004 - ACTIONSCRIPT
Page 1: ...ActionScript Reference Guide...
Page 8: ...8 Contents...
Page 12: ......
Page 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Page 54: ...54 Chapter 2 ActionScript Basics...
Page 80: ...80 Chapter 3 Writing and Debugging Scripts...
Page 82: ......
Page 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Page 112: ......
Page 120: ...120 Chapter 6 Using the Built In Classes...
Page 176: ......
Page 192: ...192 Chapter 10 Working with External Data...
Page 202: ...202 Chapter 11 Working with External Media...
Page 204: ......
Page 782: ...782 Chapter 12 ActionScript Dictionary...
Page 793: ...Other keys 793 221 222 Key Key code...
Page 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Page 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Page 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Page 816: ...816 Index...