User Guide

598 ActionScript classes
Methods inherited from class Object
attachSound (Sound.attachSound method)
public attachSound(id:String) : Void
Attaches the sound specified in the id 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.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
id:String - The identifier of an exported sound in the library. The identifier is located in the
Linkage Properties dialog box.
Example
The following example attaches the sound logoff_id to my_sound. A sound in the library
has the linkage identifier
logoff_id.
var my_sound:Sound = new Sound();
my_sound.attachSound("logoff_id");
my_sound.start();
duration (Sound.duration property)
public duration : Number [read-only]
The duration of a sound, in milliseconds.
Note: Flash Lite 2.0 supports this property for native Flash sound only. The sound formats
that are specific to a host device are not supported.
Availability: ActionScript 1.0; Flash Lite 2.0
addProperty (Object.addProperty method), hasOwnProperty
(Object.hasOwnProperty method), isPropertyEnumerable
(Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf
method), registerClass (Object.registerClass method), toString
(Object.toString method), unwatch (Object.unwatch method), valueOf
(Object.valueOf method), watch (Object.watch method)