FrameImpulseListener
Processor
executes any StepByStepProcess
for step based code execution.
MM Flash Player has got a time limit for the execution of code. Processor
allows to seperate code into steps.
It executes every step of a added StepByStepProcess
.
If the StepByStepProcess
reaches the (@link #MAX_EXECUTION_TIME}
limit during the exeuction, the Processor
pauses for one frame as
workaround for this time limitation.
Within the pause, anything may happen. It may require a complex implemnetation
strategy within the StepByStepProcess
.
Processor
observes FrameImpulse if any StepByStepProcess
has to be executed. It automatically removes itself as observer if all
processes have finished.
Processor
is built as singleton. It is possible to access it by
Processor.getInstance()
.
static public MAX_EXECUTION_TIME:Number
static public function getInstance(Void):Processor
Singleton - returns the default instance of the Processor
instance of the Processor
public function addStepByStepProcess(p:StepByStepProcess):Void
Adds a new StepByStepProcess
to the execution list.
It is possible that a StepByStepProcess
can be added twice.
The Processor
will automatically awake from stand-by.
p | StepByStepProcess to be added
|
public function removeStepByStepProcess(p:StepByStepProcess):Void
Removes all occurances of StepByStepProcess
.
p | StepByStepProcess to be removed
|
public function onFrameImpulse(impulse:FrameImpulse):Void
Handling of the event of FrameImpulse.
impulse | FrameImpulse that executes the impulse
|
onFrameImpulse() in org.as2lib.env.event.impulse.FrameImpulseListener