Access keys

SoundClip

Kind of class: class
Inherits from: Dispatcher
Classpath: org.asapframework.management.sound.SoundClip
File last modified: Tuesday, 03 October 2006, 09:43:52
The SoundClip class is used for controlling individual sounds through the SoundManager class.

For most common operations, such as starting, stopping and setting volume, it is recommended to use the SoundManager functions instead of the SoundClip.
Events broadcast to listeners:
SoundClipEvent with type: ON_LOADED
SoundClipEvent.ON_ERROR

Constructor

SoundClip

function SoundClip (
inName:String, inMovieName:String, inSound:EventSound, inMovieClip:MovieClip, inVolume:Number)
Constructor
Parameters:
inName :
unique identifying name
inMovieName:
name of the container movie that contains the movieclip for this sound
inSound :
the EventSound object that contains or will contain the actual sound
inMovieClip:
the movieclip that owns the sound
inVolume :
the initial volume of the sound

Instance properties

isExternal

isExternal:Boolean
(read)
True if the sound is external

isLoaded

isLoaded:Boolean
(read)
True if an external sound has loaded

isLooping

isLooping:Boolean
(read)
true if the sound loops

isPlaying

isPlaying:Boolean
(read)
true if the sound is playing

movieclip

movieclip:MovieClip
(read)
The movieclip that owns the sound

movieName

movieName:String
(read)
The name of the container movie

name

name:String
(read)
The identifying name

sound

sound:EventSound
(read,write)
The EventSound object that contains the actual sound

url

url:String
(read)
The url of the external sound

volume

volume:Number
(read,write)
The volume of the sound, 0 - 100

Instance methods

loadExternalSound

function loadExternalSound (
inUrl:String) : Void
Load an external sound from a url. An event (either SoundClipEvent.ON_LOADED or SoundClipEvent.ON_ERROR) is fired after loading. On local systems, this event can come during this call.
The sound is loaded entirely before it can be played.
Parameters:
inUrl:
the url for the sound to be loaded.

mute

function mute (
) : Void
Set the volume of the sound to 0. The original volume is preserved, and can be restored with unmute().

setStreaming

function setStreaming (
inURL:String) : Void
Set the sound to stream when playing, and the url to play a stream from. This does not start playing - use startSound for that purpose.
Parameters:
inURL:
the url of the sound to be streamed

startSound

function startSound (
playCount:Number) : Void
Start playing the sound. If it is playing, stop it first.
Parameters:
playCount:
the number of times to play the sound. If 0 or less, the sound loops infinitely

stop

function stop (
) : Void
Stop the sound

toString

function toString (
) : String

unmute

function unmute (
) : Void
Restore the original volume of the sound.