Packageorg.as3lib.kitchensync.action
Classpublic class KSSoundController
InheritanceKSSoundController Inheritance AbstractAction Inheritance flash.events.EventDispatcher

A sound that will be played back at the specified delay.



Public Properties
 PropertyDefined by
 InheritedautoDelete : Boolean
autoDelete is a flag that indicates whether the action should be deleted when it is done executing.
AbstractAction
  channel : SoundChannel
A pointer to the sound channel created by the sound object when it is played.
KSSoundController
 Inheriteddelay : int
delay is the time that will pass after the start() method is called before the action begins.
AbstractAction
  duration : *
[write-only]
KSSoundController
 InheriteddurationHasElapsed : Boolean
Checks to see whether the duration of the action has elapsed and if the _startTime is defined.
AbstractAction
 InheritedisPaused : Boolean
Will return true if the action is paused (after pause() has been called).
AbstractAction
 InheritedisRunning : Boolean
Will return true when the action is running (after start() has been called).
AbstractAction
 Inheritedname : String
The human-readable name of this action.
AbstractAction
 Inheritedoffset : int
legacy accessors.
AbstractAction
 InheritedpauseTime : Timestamp
The time at which the action was last paused.
AbstractAction
  sound : Sound
A pointer to the sound object passed into the constructor or created based on the URL.
KSSoundController
  soundOffset : int
The offset of the sound object when it is played.
KSSoundController
 InheritedstartTime : Timestamp
The time at which the action was last started.
AbstractAction
 InheritedstartTimeHasElapsed : Boolean
Checks to see whether the start time delay has elapsed and if the _startTime is defined.
AbstractAction
 Inheritedsync : Boolean
Setting sync to true will cause the action to sync up with real time even if framerate drops.
AbstractAction
 InheritedtimeStringParser : ITimeStringParser
[static] The timeStringParser will determine how strings are parsed into valid time values.
AbstractAction
Protected Properties
 PropertyDefined by
 Inherited_autoDelete : Boolean
AbstractAction
  _channel : SoundChannel
KSSoundController
 Inherited_delay : int = 0
AbstractAction
 Inherited_duration : int = 0
AbstractAction
 Inherited_name : String
AbstractAction
 Inherited_paused : Boolean = false
AbstractAction
 Inherited_pauseTime : Timestamp
AbstractAction
 Inherited_running : Boolean = false
AbstractAction
  _sound : Sound
KSSoundController
  _soundOffset : int = 0
KSSoundController
  _soundPauseTime : int = 0
Used internally to track the paused time of the audio.
KSSoundController
 Inherited_startTime : Timestamp
AbstractAction
 Inherited_sync : Boolean
AbstractAction
Public Methods
 MethodDefined by
  
KSSoundController(sound:*, delay:* = 0, soundOffset:* = 0)
Constructor.
KSSoundController
 Inherited
addEventTrigger(dispatcher:IEventDispatcher, eventType:String):void
Causes the action to start playing when a specified event is fired.
AbstractAction
 Inherited
addTrigger(trigger:AbstractAction):void
Causes the action to start playing when another event completes.
AbstractAction
  
KSSoundController
  
kill():void
Override the kill method to remove references to the sound and channel objects.
KSSoundController
  
pause():void
Override the pause functions to pause the actual sound as well as the action.
KSSoundController
 Inherited
register():void
Adds the action as a listener to the Synchronizer's update event.
AbstractAction
 Inherited
removeEventTrigger(dispatcher:IEventDispatcher, eventType:String):void
Removes an event trigger added by addEventTrigger().
AbstractAction
 Inherited
Removes a trigger added with addTrigger().
AbstractAction
 Inherited
Starts the timer for this action.
AbstractAction
  
stop():void
Override the pause functions to pause the actual sound as well as the action.
KSSoundController
  
unpause():void
Override the pause functions to pause the actual sound as well as the action.
KSSoundController
 Inherited
unregister():void
Removes the action as a listener to the Synchronizer's update event.
AbstractAction
Protected Methods
 MethodDefined by
 Inherited
complete():void
Call this when the action has completed.
AbstractAction
 Inherited
forceUpdate():void
Foreces the onUpdate() method to fire without being triggered by Synchronizer.
AbstractAction
  
onSoundComplete(event:Event):void
The event is considered complete when the sound's SOUND_COMPLETE event is fired.
KSSoundController
 Inherited
onTrigger(event:Event):void
Handler that starts playing the action that is called by a trigger event.
AbstractAction
  
When the synchronizer updates, checks to see if start time has elapsed and the song is loaded.
KSSoundController
Events
 EventSummaryDefined by
 Inherited  AbstractAction
 Inherited  AbstractAction
 Inherited  AbstractAction
 Inherited  AbstractAction
Property detail
_channelproperty
protected var _channel:SoundChannel
channelproperty 
channel:SoundChannel  [read-write]

A pointer to the sound channel created by the sound object when it is played.

Implementation
    public function get channel():SoundChannel
    public function set channel(value:SoundChannel):void
durationproperty 
duration:*  [write-only]Implementation
    public function set duration(value:*):void
_soundproperty 
protected var _sound:Sound
soundproperty 
sound:Sound  [read-write]

A pointer to the sound object passed into the constructor or created based on the URL.

Implementation
    public function get sound():Sound
    public function set sound(value:Sound):void
_soundOffsetproperty 
protected var _soundOffset:int = 0
soundOffsetproperty 
soundOffset:int  [read-write]

The offset of the sound object when it is played. For example, if this is 1000, the sound will play 1 second from the beginning of the audio file. Uses the time parser so string values are okay too.

Implementation
    public function get soundOffset():int
    public function set soundOffset(value:int):void

See also

org.as3lib.kitchensync.util.ITimeStringParser
delay
_soundPauseTimeproperty 
protected var _soundPauseTime:int = 0

Used internally to track the paused time of the audio.

Constructor detail
KSSoundController()constructor
public function KSSoundController(sound:*, delay:* = 0, soundOffset:* = 0)

Constructor.

Parameters
sound:* — - The sound to be played. Can be an object of type Sound, URLRequest, or the URL of the sound as a String.
 
delay:* (default = 0) — - The delay before starting the sound.
 
soundOffset:* (default = 0) — - The point at which to begin playing the sound in milliseconds.

Throws
— - If the sound parameter is not the correct data type.
Method detail
clone()method
public override function clone():AbstractAction

Returns
AbstractAction
kill()method 
public override function kill():void

Override the kill method to remove references to the sound and channel objects.

onSoundComplete()method 
protected function onSoundComplete(event:Event):void

The event is considered complete when the sound's SOUND_COMPLETE event is fired.

Parameters
event:Event
onUpdate()method 
protected override function onUpdate(event:KitchenSyncEvent):void

When the synchronizer updates, checks to see if start time has elapsed and the song is loaded. If so, it starts playing the song from the soundOffset and unregisters itself. If the sound hasn't loaded yet, it continues to check each frame until it is loaded, then it plays.

Parameters
event:KitchenSyncEvent
pause()method 
public override function pause():void

Override the pause functions to pause the actual sound as well as the action.

stop()method 
public override function stop():void

Override the pause functions to pause the actual sound as well as the action.

unpause()method 
public override function unpause():void

Override the pause functions to pause the actual sound as well as the action.