Packagech.capi.net.app
Classpublic class ApplicationMassLoader
InheritanceApplicationMassLoader Inheritance PriorityMassLoader Inheritance MassLoader Inheritance GlobalEventDispatcher Inheritance flash.events.EventDispatcher
Implements IMassLoader

Manages the massive loading of ApplicationFile.

See also

ApplicationFile
ApplicationFileParser
ApplicationConfigLoader


Public Properties
 PropertyDefined By
 InheritedalwaysDispatchProgressEvent : Boolean = true
Defines if the progress event should be dispatched each time or only when all the number of specified parallel files are being loaded.
MassLoader
 InheritedbytesLoaded : uint
[read-only] Defines the bytes that have been loaded.
MassLoader
 InheritedbytesTotal : uint
[read-only] Defines the total bytes to load.
MassLoader
 InheritedcloseEvent : Event
[read-only] Defines the event that happend to close the MassLoader (Event.CLOSE or Event.COMPLETE).
MassLoader
 InheritedcurrentPriority : int
[read-only] Defines the current priority of the files that are being loaded.
PriorityMassLoader
 InheriteddefaultPriority : int = 0
Defines the default priority to use for the addFile method.
PriorityMassLoader
 InheriteddispatchGlobalEvents : Boolean
Defines if the global events must be dispatched or not.
GlobalEventDispatcher
 InheritedloadByPriority : Boolean
Defines if the loading is done by priority.
PriorityMassLoader
 Inheritedloaded : Boolean
[read-only] Defines if the ILoadManager operation is complete.
MassLoader
 InheritedloadInfo : ILoadInfo
[read-only] Defines the ILoadInfo object linked to the IMassLoader.
MassLoader
 InheritedloadPolicy : ILoadPolicy
Defines the ILoadPolicy to use.
MassLoader
 InheritednextFileToLoad : ILoadManager
[read-only] Defines the next file that will be extracted from the queue to be loaded.
MassLoader
 InheritednumFiles : uint
[read-only] Defines the total of the files in the MassLoader.
MassLoader
 InheritednumFilesLoaded : uint
[read-only] Defines the number of files loaded.
MassLoader
 InheritednumFilesLoading : uint
[read-only] Defines the number of files being currently loaded.
MassLoader
 InheritednumFilesOpen : uint
[read-only] Defines the number of files being currently open.
MassLoader
 InheritednumFilesToLoad : uint
[read-only] Defines the number of files to load.
MassLoader
 InheritedparallelFiles : uint
Defines the number of files that will be loaded simultaneously.
MassLoader
 InheritedstateIdle : Boolean
[read-only] Defines if the MassLoader is idle.
MassLoader
 InheritedstateLoading : Boolean
[read-only] Defines if the MassLoader is loading.
MassLoader
Protected Properties
 PropertyDefined By
 Inheritedfiles : IList
[read-only] Defines all the files that must be loaded.
MassLoader
 InheritedfilesLoading : IList
[read-only] Defines the files that are currently being loaded.
MassLoader
 InheritedfilesQueue : IDataStructure
Defines the data structure to use for the file enqueuing.
MassLoader
Public Methods
 MethodDefined By
  
ApplicationMassLoader(parallelFiles:uint = 0, loadByPriority:Boolean = false)
Creates a new ApplicationMassLoader object.
ApplicationMassLoader
  
Add all the ApplicationFile objects that are in a specified ApplicationContext in the loading queue.
ApplicationMassLoader
  
Add the specified ApplicationFile and its dependencies.
ApplicationMassLoader
 Inherited
Add the specified file in the loading queue with the default priority.
PriorityMassLoader
  
Add the global ApplicationFile in the loading queue.
ApplicationMassLoader
 Inherited
addPrioritizedFile(file:ILoadManager, priority:int = 0):void
Add a file with a specific priority in the loading queue.
PriorityMassLoader
 Inherited
clear():void
Clear the loading queues and files priorities.
PriorityMassLoader
 Inherited
dispatchEvent(evt:Event):Boolean
Dispatches the specified Event through the listeners.
GlobalEventDispatcher
 Inherited
Get the number of files to be loaded.
MassLoader
 Inherited
Retreives the priority of a ILoadManager object.
PriorityMassLoader
 Inherited
getFiles():Array
Get the files that will be loaded.
MassLoader
 Inherited
getFilesAtPriority(priority:int):Array
Defines the files to be loaded at the specified priority.
PriorityMassLoader
 Inherited
Retrieves the static index of the specified ILoadManager.
MassLoader
 Inherited
hasFile(file:ILoadManager):Boolean
Retrieves if a file is contained in the loading queue.
MassLoader
  
load(file:Object, context:IApplicationContext = null, withGlobalFiles:Boolean = false):ApplicationFile
Starts the loading of the specified file.
ApplicationMassLoader
 Inherited
Removes the specified file from the loading queue.
PriorityMassLoader
 Inherited
setFilePriority(file:ILoadManager, priority:int):void
Set a file priority of a ILoadManager object.
PriorityMassLoader
 Inherited
start():Boolean
Starts downloading data from the specified ILoadManager objects.
MassLoader
 Inherited
stop():void
Stops the load operation in progress.
MassLoader
 Inherited
toString():String
Lists all the files contained in this PriorityMassLoader in a String.
PriorityMassLoader
Protected Methods
 MethodDefined By
  
addLoadableFile(file:ILoadableFile, priority:int):void
Add the specified ILoadableFile to the queue within the priority.
ApplicationMassLoader
 Inherited
createMassLoadEvent(file:ILoadManager, type:String, evt:Event = null):MassLoadEvent
Creates a MassLoadEvent based on the specified ILoadManager.
PriorityMassLoader
 Inherited
Retrieves the index of a file in the loading queue (if the loading of the specified file has been started).
MassLoader
 Inherited
isComplete():Boolean
Defines if the massive loading is complete.
MassLoader
 Inherited
loadFile(file:ILoadManager):Boolean
Start the loading of a file.
MassLoader
 Inherited
Start the loading of the next file.
MassLoader
 Inherited
onClose(evt:Event):void
Event.CLOSE listener.
MassLoader
 Inherited
onComplete(evt:Event):void
Event.COMPLETE listener.
MassLoader
 Inherited
onIOError(evt:IOErrorEvent):void
IOErrorEvent.IO_ERROR listener.
MassLoader
 Inherited
onOpen(evt:Event):void
Event.OPEN listener.
MassLoader
 Inherited
onProgress(evt:ProgressEvent):void
ProgressEvent.PROGRESS listener.
MassLoader
 Inherited
onSecurityError(evt:SecurityErrorEvent):void
SecurityError.SECURITY_ERROR listener.
MassLoader
 Inherited
Processes the loading policy on the currently closed file.
MassLoader
 Inherited
Process the loading policy on the currently file that is being open.
MassLoader
 Inherited
Register the MassLoader to the specified ILoadManager object's events.
MassLoader
 Inherited
Determines which file must be loaded first.
PriorityMassLoader
 Inherited
Start the loading of the files.
PriorityMassLoader
 Inherited
Unregister the MassLoader from the specified ILoadManager object's events.
MassLoader
 Inherited
Updates the bytesLoaded and bytesTotal values.
MassLoader
Events
 Event Summary Defined By
 InheritedDispatched when the download operation stops.MassLoader
 InheritedDispatched after all the data is received.MassLoader
 InheritedDispatched when the loading of a ILoadManager is closed (eg when the loading is complete or an error has occured).MassLoader
 InheritedDispatched when the MassLoader starts the loading of a file.MassLoader
 InheritedDispatched when the loading of a ILoadManager progresses.MassLoader
 InheritedDispatched after an event is dispatched.GlobalEventDispatcher
 InheritedDispatched before an event is dispatched.GlobalEventDispatcher
 InheritedDispatched when the download operation commences following a call to the MassLoader.start() method.MassLoader
 InheritedDispatched when the loading of files with a lower priority starts.PriorityMassLoader
 InheritedDispatched when data is received as the download operation progresses.MassLoader
Constructor Detail
ApplicationMassLoader()Constructor
public function ApplicationMassLoader(parallelFiles:uint = 0, loadByPriority:Boolean = false)

Creates a new ApplicationMassLoader object.

Parameters
parallelFiles:uint (default = 0) — Defines how many file to load at the same time. This value will affect the loading only if the loadByPriority property is false.
 
loadByPriority:Boolean (default = false) — Defines if the ApplicationMassLoader must load the files by priority.
Method Detail
addAll()method
public function addAll(context:IApplicationContext):Array

Add all the ApplicationFile objects that are in a specified ApplicationContext in the loading queue.

Parameters

context:IApplicationContext — The IApplicationContext.

Returns
Array — An Array containing all the ApplicationFile added to the loading queue.

See also

addApplicationFile()method 
public function addApplicationFile(file:ApplicationFile):void

Add the specified ApplicationFile and its dependencies.

Parameters

file:ApplicationFile — The ApplicationFile to add.

addGlobalFiles()method 
public function addGlobalFiles(context:IApplicationContext):void

Add the global ApplicationFile in the loading queue.

Parameters

context:IApplicationContext — The IApplicationContext.

addLoadableFile()method 
protected function addLoadableFile(file:ILoadableFile, priority:int):void

Add the specified ILoadableFile to the queue within the priority. If the ILoadableFile is already in the loading queue, then it checks if the priority must be udpated or not.

Parameters

file:ILoadableFile — The ILoadableFile.
 
priority:int — The priority.

load()method 
public function load(file:Object, context:IApplicationContext = null, withGlobalFiles:Boolean = false):ApplicationFile

Starts the loading of the specified file. If the file isn't an ApplicationFile then the toString() method will be used to retrieve it from the specified ApplicationContext.

Parameters

file:Object — The ApplicationFile object or the name of the ApplicationFile. If this param is a String, then the IApplicationContext must be specified.
 
context:IApplicationContext (default = null) — The IApplicationContext to retrieve the ApplicationFile and global files.
 
withGlobalFiles:Boolean (default = false) — Tells the ApplicationMassLoader to automatically add the ApplicationFile that are noted as global (IApplicationContext must be specified).

Returns
ApplicationFile — The ApplicationFile being loaded.

Throws
IllegalOperationError If — the ApplicationmassLoader is currently loading.