| Package | ch.capi.net |
| Class | public class CompositeMassLoader |
| Subclasses | CompositePriorityMassLoader |
IMassLoader and LoadableFileFactory to creates
the ILoadableFile and for the loading management.
The CompositeMassLoader keeps by default a reference to the created ILoadableFile
(see the keepFiles property).
CompositeMassLoader keep a reference to the created files by default :
var cm:CompositeMassLoader = new CompositeMassLoader();
cm.addFile("myAnimation.swf");
cm.addFile("otherSWF.swf", LoadableFileType.BINARY);
cm.addFile("myVariables.txt");
cm.start();
CompositeMassLoader doesn't keep a reference to the created files :
var cm:CompositeMassLoader = new CompositeMassLoader(false);
var file1:ILoadableFile = cm.addFile("myAnimation.swf");
var file2:ILoadableFile = cm.addFile("otherSWF.swf", LoadableFileType.BINARY);
var file3:ILoadableFile = cm.addFile("myVariables.txt");
cm.start();
See also
| Property | Defined by | ||
|---|---|---|---|
| keepFiles : Boolean [read-only]
Defines if the
CompositeMassLoader must keep references on the created
ILoadableFile instances. | CompositeMassLoader | ||
| loadableFileFactory : LoadableFileFactory
Defines the
LoadableFileFactory to use. | CompositeMassLoader | ||
| massLoader : IMassLoader
Defines the
IMassLoader to use. | CompositeMassLoader | ||
| Method | Defined by | ||
|---|---|---|---|
|
CompositeMassLoader(keepFiles:Boolean = true, massLoader:IMassLoader = null, loadableFileFactory:LoadableFileFactory = null)
Creates a new
CompositeMassLoader object. | CompositeMassLoader | ||
|
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 | ||
|
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 | ||
|
clear():void
Clears the loading queue of the
IMassLoader and empty the references to the
created ILoadableFile instances. | CompositeMassLoader | ||
|
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 | ||
|
getFileAt(index:uint):ILoadableFile
Retrieves the
ILoadableFile at the specified index. | CompositeMassLoader | ||
|
getFileCount():uint
Retrieves the number of
ILoadableFile instances that have been stored. | CompositeMassLoader | ||
|
getFiles():Array
Retrieves all the files created by the
CompositeMassLoader. | CompositeMassLoader | ||
|
start():void
Starts the loading of the massive loader.
| CompositeMassLoader | ||
|
stop():void
Stops the loading of the massive loader.
| CompositeMassLoader | ||
| Method | Defined by | ||
|---|---|---|---|
|
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 | ||
|
storeFile(file:ILoadableFile):void
Stores the specified
ILoadableFile. | CompositeMassLoader | ||
| keepFiles | property |
keepFiles:Boolean [read-only]
Defines if the CompositeMassLoader must keep references on the created
ILoadableFile instances. If this is set to false, a reference must
be kept on the ILoadableFile to prevent the Garbage Collector to delete them.
public function get keepFiles():Boolean
See also
| loadableFileFactory | property |
loadableFileFactory:LoadableFileFactory [read-write]
Defines the LoadableFileFactory to use.
public function get loadableFileFactory():LoadableFileFactory
public function set loadableFileFactory(value:LoadableFileFactory):void
| massLoader | property |
massLoader:IMassLoader [read-write]
Defines the IMassLoader to use.
public function get massLoader():IMassLoader
public function set massLoader(value:IMassLoader):void
| CompositeMassLoader | () | constructor |
public function CompositeMassLoader(keepFiles:Boolean = true, massLoader:IMassLoader = null, loadableFileFactory:LoadableFileFactory = null)
Creates a new CompositeMassLoader object.
keepFiles:Boolean (default = true) — If the CompositeMassLoader must keep a reference on the created ILoadableFile instances.
|
|
massLoader:IMassLoader (default = null) — The IMassLoader to use.
|
|
loadableFileFactory:LoadableFileFactory (default = null) — The LoadableFileFactory to use.
|
| addFile | () | method |
public function 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.
url:String — url The url 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.
|
ILoadableFile —
The created ILoadableFile.
|
| addRequest | () | method |
public function 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.
request:URLRequest — The URLRequest.
|
|
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.
|
ILoadableFile —
The created ILoadableFile.
|
| clear | () | method |
public function clear():void
Clears the loading queue of the IMassLoader and empty the references to the
created ILoadableFile instances.
See also
| createFile | () | method |
public function 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. This method doesn't register the file to the IMassLoader but
it stores it into the CompositeMassLoader.
url:String — url The url 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.
|
ILoadableFile —
The created ILoadableFile.
|
| createLoadableFile | () | method |
protected function createLoadableFile(request:URLRequest, fileType:String = null):ILoadableFile
Retrieves a ILoadableFile from a URLRequest and and a specified file type
issued from the LoadableFileType constants.
request:URLRequest — The URLRequest.
|
|
fileType:String (default = null) — The type of the file.
|
ILoadableFile —
The ILoadableFile created.
|
— If the fileType is not valid.
|
See also
| getFileAt | () | method |
public function getFileAt(index:uint):ILoadableFile
Retrieves the ILoadableFile at the specified index.
index:uint — The index.
|
ILoadableFile —
The ILoadableFile.
|
| getFileCount | () | method |
public function getFileCount():uint
Retrieves the number of ILoadableFile instances that have been stored.
uint — The number of stored ILoadableFile.
|
| getFiles | () | method |
public function getFiles():Array
Retrieves all the files created by the CompositeMassLoader. Note that the CompositeMassLoader
register the files only if the keepFiles property is set to true.
Array — The created ILoadableFile.
|
| start | () | method |
public function start():voidStarts the loading of the massive loader.
See also
| stop | () | method |
| storeFile | () | method |
protected function storeFile(file:ILoadableFile):void
Stores the specified ILoadableFile.
file:ILoadableFile — The file to store.
|