Packagecom.acleveraddress.net.multi_loader.extras
Classpublic class SoundItem

Helper class used for controlling a Sound object - enables basic functionality for controlling the sound

NB If you haven't done much with sound in ActionScript before then make sure you're aware of its poor implementation - issues with Variable Bit Rate, MP3s that are less than 128kbps and the sampling rate. This is especially prevalent in FP9. Do some reading up on it now so you're not wasting time on it later...



Public Properties
 PropertyDefined by
  channel : SoundChannel
The SoundChannel you wish to associate.
SoundItem
  isMuted : Boolean
SoundItem
  isPaused : Boolean
SoundItem
  sound : Sound
The Sound object to be controlled
SoundItem
  volume : Number
The volume, ranging from 0 (silent) to 1 (full volume).
SoundItem
Public Methods
 MethodDefined by
  
SoundItem(sound:Sound, channel:SoundChannel = null)
Sets up your sound item
SoundItem
  
dispose():void
Disposes the sound
SoundItem
  
mute(flag:Boolean):void
Mutes or umutes the Sound object
SoundItem
  
pause():void
Pauses the sound
SoundItem
  
play(startTime:Number = 0, loops:int = 0, volume:Number = 1, panning:Number = 0):SoundChannel
Play the sound object
SoundItem
  
resume():void
Resumes the paused sound

If the sound wasn't paused then it will start playing again from the beginning
SoundItem
  
stop():void
Stops the sound
SoundItem
  
toggleMute():void
Toggles whether the sound is muted or not
SoundItem
Property detail
channelproperty
public var channel:SoundChannel

The SoundChannel you wish to associate.

isMutedproperty 
public var isMuted:Boolean
isPausedproperty 
public var isPaused:Boolean
soundproperty 
public var sound:Sound

The Sound object to be controlled

volumeproperty 
volume:Number  [read-write]

The volume, ranging from 0 (silent) to 1 (full volume).

Implementation
    public function get volume():Number
    public function set volume(value:Number):void
Constructor detail
SoundItem()constructor
public function SoundItem(sound:Sound, channel:SoundChannel = null)

Sets up your sound item

Parameters
sound:Sound — The Sound Object to be controlled
 
channel:SoundChannel (default = null) — The SoundChannel you wish to associate

See also

com.research_now.net.multi_loader.extras.SoundItem.sound
com.research_now.net.multi_loader.extras.SoundItem.channel
Method detail
dispose()method
public function dispose():void

Disposes the sound

mute()method 
public function mute(flag:Boolean):void

Mutes or umutes the Sound object

Parameters
flag:Boolean — Set to true to mute the sound, or false to unmute
pause()method 
public function pause():void

Pauses the sound

See also

com.research_now.net.multi_loader.extras.SoundItem.resume()
play()method 
public function play(startTime:Number = 0, loops:int = 0, volume:Number = 1, panning:Number = 0):SoundChannel

Play the sound object

Parameters
startTime:Number (default = 0) — The initial position in milliseconds at which playback should start
 
loops:int (default = 0) — Defines the number of times a sound loops back to the startTime value before the sound channel stops playback
 
volume:Number (default = 1) — The volume, ranging from 0 (silent) to 1 (full volume)
 
panning:Number (default = 0) — The left-to-right panning of the sound, ranging from -1 (full pan left) to 1 (full pan right). A value of 0 represents no panning (center)

Returns
SoundChannel — The SoundChannel object used to control the sound
resume()method 
public function resume():void

Resumes the paused sound

If the sound wasn't paused then it will start playing again from the beginning

See also

com.research_now.net.multi_loader.extras.SoundItem.pause()
stop()method 
public function stop():void

Stops the sound

toggleMute()method 
public function toggleMute():void

Toggles whether the sound is muted or not