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.
Содержание FLASH MX 2004 - ACTIONSCRIPT
Страница 1: ...ActionScript Reference Guide...
Страница 8: ...8 Contents...
Страница 12: ......
Страница 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Страница 54: ...54 Chapter 2 ActionScript Basics...
Страница 80: ...80 Chapter 3 Writing and Debugging Scripts...
Страница 82: ......
Страница 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Страница 112: ......
Страница 120: ...120 Chapter 6 Using the Built In Classes...
Страница 176: ......
Страница 192: ...192 Chapter 10 Working with External Data...
Страница 202: ...202 Chapter 11 Working with External Media...
Страница 204: ......
Страница 782: ...782 Chapter 12 ActionScript Dictionary...
Страница 793: ...Other keys 793 221 222 Key Key code...
Страница 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Страница 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Страница 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Страница 816: ...816 Index...