Packagech.capi.net
Classpublic class CompositePriorityMassLoader
InheritanceCompositePriorityMassLoader Inheritance CompositeMassLoader

This is a utility class to avoid too much verbose code within the masapi API. Note that this class simply uses the IMassLoader and LoadableFileFactory to creates the ILoadableFile and for the loading management.

The difference with the CompositeMassLoader is that this class uses directly a PriorityMassLoader and provides some more methods to add the files.


Example
  var cm:CompositePriorityMassLoader = new CompositePriorityMassLoader();
  cm.addPrioritizedFile("myAnimation.swf", 5);
  cm.addFile("otherSWF.swf", LoadableFileType.BINARY); //priority = 0
  cm.addPrioritizedFile("myVariables.php", 3, LoadableFileType.TEXT);
  
  cm.start();
  

See also

PriorityMassLoader
LoadableFileFactory
IMassLoader


Public Properties
 PropertyDefined by
 InheritedkeepFiles : Boolean
Defines if the CompositeMassLoader must keep references on the created ILoadableFile instances.
CompositeMassLoader
 InheritedloadableFileFactory : LoadableFileFactory
Defines the LoadableFileFactory to use.
CompositeMassLoader
  massLoader : IMassLoader
Defines the PriorityMassLoader to use.
CompositePriorityMassLoader
Public Methods
 MethodDefined by
  
CompositePriorityMassLoader(keepFiles:Boolean = true, massLoader:PriorityMassLoader = null, factory:LoadableFileFactory = null)
Creates a new CompositePriorityMassLoader object.
CompositePriorityMassLoader
 Inherited
addFile(url:String, fileType:String = null, onOpen:Function = null, onProgress:Function = null, onComplete:Function = null, onClose:Function = null, onIOError:Function = null, onSecurityError:Function = null):ILoadableFile
Creates a ILoadableFile from a url and add it to the current loading queue.
CompositeMassLoader
  
addPrioritizedFile(url:String, priority:int, fileType:String = null, onOpen:Function = null, onProgress:Function = null, onComplete:Function = null, onClose:Function = null, onIOError:Function = null, onSecurityError:Function = null):ILoadableFile
Creates a ILoadableFile from a url and add it to the current loading queue.
CompositePriorityMassLoader
  
addPrioritizedRequest(request:URLRequest, priority:int, fileType:String = null, onOpen:Function = null, onProgress:Function = null, onComplete:Function = null, onClose:Function = null, onIOError:Function = null, onSecurityError:Function = null):ILoadableFile
Creates a ILoadableFile from a URLRequest and add it to the current loading queue.
CompositePriorityMassLoader
 Inherited
addRequest(request:URLRequest, fileType:String = null, onOpen:Function = null, onProgress:Function = null, onComplete:Function = null, onClose:Function = null, onIOError:Function = null, onSecurityError:Function = null):ILoadableFile
Creates a ILoadableFile from a URLRequest and add it to the current loading queue.
CompositeMassLoader
 Inherited
clear():void
Clears the loading queue of the IMassLoader and empty the references to the created ILoadableFile instances.
CompositeMassLoader
 Inherited
createFile(url:String, fileType:String = null, onOpen:Function = null, onProgress:Function = null, onComplete:Function = null, onClose:Function = null, onIOError:Function = null, onSecurityError:Function = null):ILoadableFile
Creates a ILoadableFile from a url.
CompositeMassLoader
 Inherited
getFileAt(index:uint):ILoadableFile
Retrieves the ILoadableFile at the specified index.
CompositeMassLoader
 Inherited
getFileCount():uint
Retrieves the number of ILoadableFile instances that have been stored.
CompositeMassLoader
 Inherited
getFiles():Array
Retrieves all the files created by the CompositeMassLoader.
CompositeMassLoader
 Inherited
start():void
Starts the loading of the massive loader.
CompositeMassLoader
 Inherited
stop():void
Stops the loading of the massive loader.
CompositeMassLoader
Protected Methods
 MethodDefined by
 Inherited
createLoadableFile(request:URLRequest, fileType:String = null):ILoadableFile
Retrieves a ILoadableFile from a URLRequest and and a specified file type issued from the LoadableFileType constants.
CompositeMassLoader
 Inherited
Stores the specified ILoadableFile.
CompositeMassLoader
Property detail
massLoaderproperty
massLoader:IMassLoader  [read-write]

Defines the PriorityMassLoader to use. If the value is of another type, then a ArgumentError will be thrown.

Implementation
    public function get massLoader():IMassLoader
    public function set massLoader(value:IMassLoader):void
Constructor detail
CompositePriorityMassLoader()constructor
public function CompositePriorityMassLoader(keepFiles:Boolean = true, massLoader:PriorityMassLoader = null, factory:LoadableFileFactory = null)

Creates a new CompositePriorityMassLoader object.

Parameters
keepFiles:Boolean (default = true) — If the CompositeMassLoader must keep a reference on the created ILoadableFile instances.
 
massLoader:PriorityMassLoader (default = null) — The PriorityMassLoader to use.
 
factory:LoadableFileFactory (default = null) — The LoadableFileFactory to use.

See also

Method detail
addPrioritizedFile()method
public function addPrioritizedFile(url:String, priority:int, fileType:String = null, onOpen:Function = null, onProgress:Function = null, onComplete:Function = null, onClose:Function = null, onIOError:Function = null, onSecurityError:Function = null):ILoadableFile

Creates a ILoadableFile from a url and add it to the current loading queue.

Parameters
url:String — url The url of the file.
 
priority:int — The priority of the file.
 
fileType:String (default = null) — The type of the file.
 
onOpen:Function (default = null) — The Event.OPEN listener.
 
onProgress:Function (default = null) — The ProgressEvent.PROGRESS listener.
 
onComplete:Function (default = null) — The Event.COMPLETE listener.
 
onClose:Function (default = null) — The Event.CLOSE listener.
 
onIOError:Function (default = null) — The IOErrorEvent.IO_ERROR listener.
 
onSecurityError:Function (default = null) — The SecurityErrorEvent.SECURITY_ERROR listener.

Returns
ILoadableFile — The created ILoadableFile.
addPrioritizedRequest()method 
public function addPrioritizedRequest(request:URLRequest, priority:int, fileType:String = null, onOpen:Function = null, onProgress:Function = null, onComplete:Function = null, onClose:Function = null, onIOError:Function = null, onSecurityError:Function = null):ILoadableFile

Creates a ILoadableFile from a URLRequest and add it to the current loading queue.

Parameters
request:URLRequest — The URLRequest.
 
priority:int — The priority of the file.
 
fileType:String (default = null) — The type of the file.
 
onOpen:Function (default = null) — The Event.OPEN listener.
 
onProgress:Function (default = null) — The ProgressEvent.PROGRESS listener.
 
onComplete:Function (default = null) — The Event.COMPLETE listener.
 
onClose:Function (default = null) — The Event.CLOSE listener.
 
onIOError:Function (default = null) — The IOErrorEvent.IO_ERROR listener.
 
onSecurityError:Function (default = null) — The SecurityErrorEvent.SECURITY_ERROR listener.

Returns
ILoadableFile — The created ILoadableFile.