View comments | RSS feed

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 Player 5

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();

Flash CS3


Comments


No screen name said on Aug 27, 2007 at 4:22 PM :
I'm loading an SWF (child) into an existing movie (parent). The attachMovie function ceases to... function... in the child MC. I've used lockroot and all that good stuff, and I can get attachMovie to work just fine. Anyone have any suggestions?

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00002126.html