Packagecom.sibirjak.angara.monitor
Classpublic class Monitor
InheritanceMonitor Inheritance AbstractProgressInfo Inheritance flash.events.EventDispatcher
ImplementsIMonitor

The monitor takes care of the loading progess of a list of loader items.

The monitor holds an internal map to track the progress of its added loader item objects. The progress will be calculated incrementally to achieve the best possible performance. In order to do so, the monitor calculates the differences between two states of a loader item and adds this difference to the overall progress properties.

Generally the overall progress is the arithmetic average of all items added. It is though possible to give each element a specific weight. This can be useful for displaying a progress bar respecting the different sizes of the particular resources.

Adding a sequence uses its numItems property to calculate the weight of the sequence within the monitor. So adding one resource loader and a sequence of 3 items would this way result in a cumulative weight of 4. Finishing the sequence would change the monitor's progress to .75 then.

Sequences uses an internal monitor to calculate the sequence progress.



Public Properties
 PropertyDefined by
 InheritednumItems : uint
Returns the number of items to be loaded within the loader item.
AbstractProgressInfo
 InheritednumItemsFailed : uint
Returns the number of items failed within the loader item.
AbstractProgressInfo
 InheritednumItemsLoaded : uint
Returns the number of items loaded within the loader item.
AbstractProgressInfo
 Inheritedprogress : Number
Returns the progress of the loader item as a decimal value between zero and 1.
AbstractProgressInfo
Protected Properties
 PropertyDefined by
 Inherited_numItems : uint = 0
The number of items added.
AbstractProgressInfo
 Inherited_numItemsFailed : uint = 0
The number of items failed loading.
AbstractProgressInfo
 Inherited_numItemsLoaded : uint = 0
The number of items alredy loaded.
AbstractProgressInfo
 Inherited_progress : Number = 0
The overall progress of the item.
AbstractProgressInfo
Public Methods
 MethodDefined by
  
Creates a new monitor.
Monitor
  
add(loaderItem:ILoaderItem, weight:uint = 0):void
Adds a loader item to a progress monitor.
Monitor
  
clear():void
Removes all loader item references from the progress monitor.
Monitor
  
remove(loaderItem:ILoaderItem):void
Removes a loader item from the progress monitor.
Monitor
  
toString():String
Info
Monitor
Protected Methods
 MethodDefined by
  
Dispatches the MonitorEvent.COMPLETE event.
Monitor
  
Dispatches the MonitorEvent.PROGRESS event.
Monitor
Constructor detail
Monitor()constructor
public function Monitor()

Creates a new monitor.

Method detail
add()method
public function add(loaderItem:ILoaderItem, weight:uint = 0):void

Adds a loader item to a progress monitor.

You can add any loader item type (resource loader, sequence, sequence manager).

If no weight parameter is given, the monitor uses the items.numItems property for the weight. Adding one resource loader and a sequence of 3 items would this way result in a cumulative weight of 4. Finishing the sequence would change the monitor's progress to .75 then.

Parameters
loaderItem:ILoaderItem — The loader item to be monitored.
 
weight:uint (default = 0) — The weight of the item within all monitor item's
clear()method 
public function clear():void

Removes all loader item references from the progress monitor.

dispatchMonitorComplete()method 
protected function dispatchMonitorComplete():void

Dispatches the MonitorEvent.COMPLETE event.

dispatchProgress()method 
protected function dispatchProgress():void

Dispatches the MonitorEvent.PROGRESS event.

remove()method 
public function remove(loaderItem:ILoaderItem):void

Removes a loader item from the progress monitor.

Parameters
loaderItem:ILoaderItem — The loader to be removed.
toString()method 
public override function toString():String

Info

Returns
String