Packagecom.pblabs.sound
Classpublic class BackgroundMusicComponent
InheritanceBackgroundMusicComponent Inheritance TickedComponent Inheritance EntityComponent Inheritance Object

Simple component to manage background music.



Public Properties
 PropertyDefined By
  autoStart : Boolean = true
BackgroundMusicComponent
 InheritedisRegistered : Boolean
[read-only] Whether or not the component is currently registered with an entity.
EntityComponent
  music : SoundResource
BackgroundMusicComponent
  musicUrl : String
BackgroundMusicComponent
 Inheritedname : String
[read-only] The name given to the component when it is added to an entity.
EntityComponent
 Inheritedowner : IEntity
A reference to the entity that this component currently belongs to.
EntityComponent
  playing : Boolean
[read-only]
BackgroundMusicComponent
 InheritedregisterForTicks : Boolean
Set to register/unregister for tick updates.
TickedComponent
 InheritedupdatePriority : Number = 0.0
The update priority for this component.
TickedComponent
Protected Properties
 PropertyDefined By
  handle : SoundHandle
BackgroundMusicComponent
Public Methods
 MethodDefined By
  
onTick(tickRate:Number):void
[override]
BackgroundMusicComponent
 Inherited
register(owner:IEntity, name:String):void
Registers the component with an entity.
EntityComponent
 Inherited
reset():void
This is called by an entity on all of its components any time a component is added or removed.
EntityComponent
  
start():void
BackgroundMusicComponent
  
stop():void
BackgroundMusicComponent
 Inherited
unregister():void
Unregisters the component from an entity.
EntityComponent
Protected Methods
 MethodDefined By
  
onAdd():void
[override]
BackgroundMusicComponent
  
onRemove():void
[override]
BackgroundMusicComponent
 Inherited
onReset():void
This is called anytime a component is added or removed from the owner entity.
EntityComponent
Property Detail
autoStartproperty
public var autoStart:Boolean = true

handleproperty 
protected var handle:SoundHandle

musicproperty 
public var music:SoundResource

musicUrlproperty 
public var musicUrl:String

playingproperty 
playing:Boolean  [read-only]


Implementation
    public function get playing():Boolean
Method Detail
onAdd()method
override protected function onAdd():void

onRemove()method 
override protected function onRemove():void

onTick()method 
override public function onTick(tickRate:Number):void

Parameters

tickRate:Number

start()method 
public function start():void

stop()method 
public function stop():void