Packageweavejs.core
Classpublic class Scheduler
InheritanceScheduler Inheritance Object
Implements IScheduler, IDisposableObject

This allows you to add callbacks that will be called when an event occurs on the stage. WARNING: These callbacks will trigger on every mouse and keyboard event that occurs on the stage. Developers should not add any callbacks that run computationally expensive code.



Public Properties
 PropertyDefined By
  averageFrameTime : int = 0
Scheduler
  currentFrameElapsedTime : int
[read-only]
Scheduler
  debug_async_stack_elapsed : Boolean = false
[static]
Scheduler
  debug_async_time : Boolean = false
[static]
Scheduler
  debug_callLater : Boolean = false
[static]
Scheduler
  debug_delayTasks : Boolean = false
[static]
Scheduler
  debug_fps : Boolean = false
[static]
Scheduler
  debug_visibility : Boolean = false
[static]
Scheduler
  frameCallbacks : ICallbackCollection
[read-only]
Scheduler
  maxComputationTimePerFrame : uint = 100
When the current frame elapsed time reaches this threshold, callLater processing will be done in later frames.
Scheduler
  previousFrameElapsedTime : int
[read-only]
Scheduler
Public Methods
 MethodDefined By
  
Scheduler
  
callLater(relevantContext:Object, method:Function, parameters:Array = null):void
Scheduler
  
debugTime(str:String):int
[static]
Scheduler
  
dispose():void
Scheduler
  
generateCompoundIterativeTask(... iterativeTasks):Function
[static] This will generate an iterative task function that is the combination of a list of tasks to be completed in order.
Scheduler
  
This gets the maximum milliseconds spent per frame performing asynchronous tasks.
Scheduler
  
getTaskPriorityTimeAllocation(priority:uint):uint
This will get the time allocation for a specific task priority.
Scheduler
  
This sets the maximum milliseconds spent per frame performing asynchronous tasks.
Scheduler
  
setTaskPriorityTimeAllocation(priority:uint, milliseconds:uint):void
This will set the time allocation for a specific task priority.
Scheduler
  
startTask(relevantContext:Object, iterativeTask:Function, priority:uint, finalCallback:Function = null, description:String = null):void
Scheduler
Property Detail
averageFrameTimeproperty
public var averageFrameTime:int = 0

currentFrameElapsedTimeproperty 
currentFrameElapsedTime:int  [read-only]


Implementation
    public function get currentFrameElapsedTime():int
debug_async_stack_elapsedproperty 
public static var debug_async_stack_elapsed:Boolean = false

debug_async_timeproperty 
public static var debug_async_time:Boolean = false

debug_callLaterproperty 
public static var debug_callLater:Boolean = false

debug_delayTasksproperty 
public static var debug_delayTasks:Boolean = false

debug_fpsproperty 
public static var debug_fps:Boolean = false

debug_visibilityproperty 
public static var debug_visibility:Boolean = false

frameCallbacksproperty 
frameCallbacks:ICallbackCollection  [read-only]


Implementation
    public function get frameCallbacks():ICallbackCollection
maxComputationTimePerFrameproperty 
public var maxComputationTimePerFrame:uint = 100

When the current frame elapsed time reaches this threshold, callLater processing will be done in later frames.

previousFrameElapsedTimeproperty 
previousFrameElapsedTime:int  [read-only]


Implementation
    public function get previousFrameElapsedTime():int
Constructor Detail
Scheduler()Constructor
public function Scheduler()



Method Detail
callLater()method
public function callLater(relevantContext:Object, method:Function, parameters:Array = null):void

Parameters

relevantContext:Object
 
method:Function
 
parameters:Array (default = null)

debugTime()method 
public static function debugTime(str:String):int

Parameters

str:String

Returns
int
dispose()method 
public function dispose():void

generateCompoundIterativeTask()method 
public static function generateCompoundIterativeTask(... iterativeTasks):Function

This will generate an iterative task function that is the combination of a list of tasks to be completed in order.

Parameters

... iterativeTasks — An Array of iterative task functions.

Returns
Function — A single iterative task function that invokes the other tasks to completion in order. The function will accept a stopTime:int parameter which when set to -1 will reset the task counter to zero so the compound task will start from the first task again.

See also

getMaxComputationTimePerFrame()method 
public function getMaxComputationTimePerFrame():uint

This gets the maximum milliseconds spent per frame performing asynchronous tasks.

Returns
uint
getTaskPriorityTimeAllocation()method 
public function getTaskPriorityTimeAllocation(priority:uint):uint

This will get the time allocation for a specific task priority.

Parameters

priority:uint — The task priority defined by one of the constants in WeaveAPI.

Returns
uint — The time allocation for the specified task priority.
setMaxComputationTimePerFrame()method 
public function setMaxComputationTimePerFrame(value:uint):void

This sets the maximum milliseconds spent per frame performing asynchronous tasks.

Parameters

value:uint — new value.

setTaskPriorityTimeAllocation()method 
public function setTaskPriorityTimeAllocation(priority:uint, milliseconds:uint):void

This will set the time allocation for a specific task priority.

Parameters

priority:uint — The task priority defined by one of the constants in WeaveAPI.
 
milliseconds:uint — The new time allocation for the specified task priority.

startTask()method 
public function startTask(relevantContext:Object, iterativeTask:Function, priority:uint, finalCallback:Function = null, description:String = null):void

Parameters

relevantContext:Object
 
iterativeTask:Function
 
priority:uint
 
finalCallback:Function (default = null)
 
description:String (default = null)