static public onLightUpdatedEVENT:EventTypestatic public MAX_POWER:Numberpublic function setPower(n:Number)The the power of the light. A number between 0 and MAX_POWER is necessary. The highter the power of the light is, the less the shadows are visibles.
n | Number a Number between 0 and MAX_POWER. This number is the light intensity. |
public function getPower(Void):NumberReturns the power of the light.
Number a number between 0 - MAX_POWER.
public function getNormalizedPower():NumberReturns the power of the light normalized to the range 0 -> 1
Number a number between 0 and 1
public function setDirection(x:Number, y:Number, z:Number):Void
Set the position of the Light3D.
x | the x coordinate |
y | the y coordinate |
z | the z coordinate |
public function calculate(normal:Vector):NumberCalculate the strength of this light based on the supplied normal
Number the strength between 0 and 1
public function addEventListener(t:String, oL):Void
Adds passed-in oL listener for receiving passed-in t event type.
Take a look at example below to see all possible method call.
Example
var oEB : IEventDispatcher = new EventBroadcaster(this);
oEB.addEventListener( myClass.onSometingEVENT, myFirstObject);
oEB.addEventListener( myClass.onSometingElseEVENT, this, __onSomethingElse);
oEB.addEventListener( myClass.onSometingElseEVENT, this, Delegate.create(this, __onSomething) );
t | Name of the Event. |
oL | Listener object. |
public function removeEventListener(t:String, oL):Void
Removes passed-in oL listener that suscribed for passed-in t event.
Example
var oEB : IEventDispatcher = new EventBroadcaster(this);
oEB.removeEventListener( myClass.onSometingEVENT, myFirstObject);
oEB.removeEventListener( myClass.onSometingElseEVENT, this);
t | Name of the Event. |
oL | Listener object. |
public function dispatchEvent(o:Object):Void
Wrapper for Macromedia EventDispatcher polymorphism.
Example
var oEB : IEventDispatcher = new EventBroadcaster(this);
oEB.dispatchEvent( {type:'onSomething', target:this, param:12} );
o | Event object. |
public function broadcastEvent(e:IEvent):VoidBroadcasts event to suscribed listeners.
Example using full Pixlib API
var oEB : IEventDispatcher = new EventBroadcaster(this);
var e : IEvent = new BasicEvent( myClass.onSomeThing, this);
oEB.addEventListener( myClass.onSomeThing, this);
oEB.broadcastEvent( e );
e | an IEvent instance |