15Built-in Classes: The Sound Class

The Sound Class

The Sound class is used to control sounds within an application. Simple sounds can be added manually to the Main Timeline and to the timelines of MovieClips and Buttons. But to have the most control over the audio in an application, sounds are controlled through instances of the Sound class.

Sound instances are created in the usual way:

mySound :Sound = new Sound(target);

The parameter, “target”, specifies the MovieClip that this sound instance will be attached to. If the target parameter is omitted, the Sound instance will be attached to the Main Timeline. Choosing the associated MovieClip is important because all sounds attached to a given MovieClip will share certain properties like volume, ...

Get Understanding Macromedia Flash 8 ActionScript 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.