| Package | org.as3lib.kitchensync.action |
| Class | public class KSSoundController |
| Inheritance | KSSoundController AbstractAction flash.events.EventDispatcher |
| Property | Defined by | ||
|---|---|---|---|
![]() | autoDelete : 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 | ||
![]() | delay : int
delay is the time that will pass after the start() method is called
before the action begins.
| AbstractAction | |
| duration : * [write-only]
| KSSoundController | ||
![]() | durationHasElapsed : Boolean
Checks to see whether the duration of the action has elapsed and if the _startTime is defined.
| AbstractAction | |
![]() | isPaused : Boolean
Will return true if the action is paused (after pause() has been called).
| AbstractAction | |
![]() | isRunning : Boolean
Will return true when the action is running (after start() has been called).
| AbstractAction | |
![]() | name : String
The human-readable name of this action.
| AbstractAction | |
![]() | offset : int
legacy accessors.
| AbstractAction | |
![]() | pauseTime : 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 | ||
![]() | startTime : Timestamp
The time at which the action was last started.
| AbstractAction | |
![]() | startTimeHasElapsed : Boolean
Checks to see whether the start time delay has elapsed and if the _startTime is defined.
| AbstractAction | |
![]() | sync : Boolean
Setting sync to true will cause the action to sync up with real time
even if framerate drops.
| AbstractAction | |
![]() | timeStringParser : ITimeStringParser
[static]
The timeStringParser will determine how strings are parsed into valid
time values.
| AbstractAction | |
| Property | Defined by | ||
|---|---|---|---|
![]() | _autoDelete : Boolean | AbstractAction | |
| _channel : SoundChannel | KSSoundController | ||
![]() | _delay : int = 0 | AbstractAction | |
![]() | _duration : int = 0 | AbstractAction | |
![]() | _name : String | AbstractAction | |
![]() | _paused : Boolean = false | AbstractAction | |
![]() | _pauseTime : Timestamp | AbstractAction | |
![]() | _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 | ||
![]() | _startTime : Timestamp | AbstractAction | |
![]() | _sync : Boolean | AbstractAction | |
| Method | Defined by | ||
|---|---|---|---|
|
KSSoundController(sound:*, delay:* = 0, soundOffset:* = 0)
Constructor.
| KSSoundController | ||
![]() |
addEventTrigger(dispatcher:IEventDispatcher, eventType:String):void
Causes the action to start playing when a specified event is fired.
| AbstractAction | |
![]() |
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 | ||
![]() |
register():void
Adds the action as a listener to the Synchronizer's update event.
| AbstractAction | |
![]() |
removeEventTrigger(dispatcher:IEventDispatcher, eventType:String):void
Removes an event trigger added by addEventTrigger().
| AbstractAction | |
![]() |
removeTrigger(trigger:AbstractAction):void
Removes a trigger added with addTrigger().
| AbstractAction | |
![]() |
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 | ||
![]() |
unregister():void
Removes the action as a listener to the Synchronizer's update event.
| AbstractAction | |
| Method | Defined by | ||
|---|---|---|---|
![]() |
complete():void
Call this when the action has completed.
| AbstractAction | |
![]() |
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 | ||
![]() |
onTrigger(event:Event):void
Handler that starts playing the action that is called by a trigger event.
| AbstractAction | |
|
onUpdate(event:KitchenSyncEvent):void
When the synchronizer updates, checks to see if start time has elapsed and the song is loaded.
| KSSoundController | ||
| _channel | property |
protected var _channel:SoundChannel
| channel | property |
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
| duration | property |
duration:* [write-only]Implementation
public function set duration(value:*):void
| _sound | property |
protected var _sound:Sound
| sound | property |
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
| _soundOffset | property |
protected var _soundOffset:int = 0
| soundOffset | property |
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
| _soundPauseTime | property |
protected var _soundPauseTime:int = 0Used internally to track the paused time of the audio.
| KSSoundController | () | constructor |
public function KSSoundController(sound:*, delay:* = 0, soundOffset:* = 0)Constructor.
Parameterssound:* — - 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.
|
— - If the sound parameter is not the correct data type.
|
| clone | () | method |
| kill | () | method |
public override function kill():voidOverride the kill method to remove references to the sound and channel objects.
| onSoundComplete | () | method |
protected function onSoundComplete(event:Event):voidThe event is considered complete when the sound's SOUND_COMPLETE event is fired.
Parametersevent:Event |
| onUpdate | () | method |
protected override function onUpdate(event:KitchenSyncEvent):voidWhen 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.
Parametersevent:KitchenSyncEvent |
| pause | () | method |
public override function pause():voidOverride the pause functions to pause the actual sound as well as the action.
| stop | () | method |
public override function stop():voidOverride the pause functions to pause the actual sound as well as the action.
| unpause | () | method |
public override function unpause():voidOverride the pause functions to pause the actual sound as well as the action.