| Package | com.acleveraddress.net.multi_loader |
| Class | public class MultiLoader |
| Inheritance | MultiLoader AbstractClass flash.events.EventDispatcher |
var ml : MultiLoader = MultiLoader.getLoader("my_loader");
ml.add("http://www.my_site.com/my_image.jpg", MultiLoaderTypes.IMAGE);
ml.start();
See also
| Property | Defined by | ||
|---|---|---|---|
| allLoaded : Boolean [read-only]
Returns true if all items have completed loading
| MultiLoader | ||
| connections : uint = 4
Maximum number of assets (simultaneous connections) that can be downloaded at one time.
| MultiLoader | ||
| connectionsPerHost : uint = 4 | MultiLoader | ||
| debug : uint = 3 [static]
Debug level
| MultiLoader | ||
| failedItems : Array
A list of all items which failed to load
| MultiLoader | ||
| items : Array
Array of all added items in loader
| MultiLoader | ||
| _name : String
Managed internally by MultiLoaderManager
| MultiLoader | ||
| name : String [read-only]
Returns the MultiLoader instance's name - may only be set when instantiating
| MultiLoader | ||
| onComplete : Function
Executed when all items have completed
| MultiLoader | ||
| onCompleteParams : Array
Parameters applied to the onComplete Function.
| MultiLoader | ||
| onProgress : Function
Executed on every progress event.
| MultiLoader | ||
| onProgressParams : Array
Parameters applied to the onUpdate Function.
| MultiLoader | ||
| percentageScale : uint = 1 [static]
What the loading percentages are returned as
If this is set to 100 then you'll get back an actual percent
If this is set to 1 then you'll get back a value between 0-1
| MultiLoader | ||
| preventCaching : Boolean [static]
Default setting for whether files should prevent caching
May be overridden by the item itself
| MultiLoader | ||
| retries : uint = 3 [static]
Default setting for how many retries files should try in the event of a failure
May be overridden by the item itself
| MultiLoader | ||
| startTime : uint
When the loader is started
| MultiLoader | ||
| Method | Defined by | ||
|---|---|---|---|
|
MultiLoader(flag:Boolean = false)
This is the MultiLoader constructor, but it's not for access outside the MultiLoader library
Instead use MultiLoader.getLoader(name), eg: var ml : MultiLoader = MultiLoader.getLoader("my_loader");
| MultiLoader | ||
|
add(path:String, type:String = "", props:Object = null, params:Object = null):MultiLoaderItem
For adding an item to the loader
| MultiLoader | ||
|
addItem(item:MultiLoaderItem):void
Adds an item directly to this loader
| MultiLoader | ||
|
dispose():void
Disposes this MultiLoader instance
| MultiLoader | ||
|
forceImmediateLoad(key:*):void
Once an item has been added, it may be forced into the queue immediately using this method which,
if all connections are being used, removes the item with the lowest priority from the queue
| MultiLoader | ||
|
getContent(key:*, clearMemory:Boolean = false):*
Returns a MultiLoaderItem's content from its key.
| MultiLoader | ||
|
getItem(key:*):MultiLoaderItem
Returns a MultiLoaderItem from its key
| MultiLoader | ||
|
getLoader(name:String):MultiLoader
[static]
The way to instantiate a new MultiLoader instance, or retrieve one which has already been created
If the name is already in use, then that loader will be returned, otherwise a new instance will
be created.
| MultiLoader | ||
|
getParams(key:*):Object
Returns a MultiLoaderItem's params from its key
| MultiLoader | ||
|
pause():void
Pauses all items so no loading takes place
Any items which were partially loaded may or may not lose the bytes loaded
so far, depending on the browser being used
| MultiLoader | ||
|
remove(key:*):Boolean
Remove a single item from this loader
| MultiLoader | ||
|
removeAll():void
Removes all items from this loader
| MultiLoader | ||
|
removeItem(evt:MultiLoaderEvent):void
Cleans up after an item has been removed
| MultiLoader | ||
|
resume():void
Resumes all paused items
Any items which were partially loaded may have to start loading from
scratch, depending on the browser being used
| MultiLoader | ||
|
start():void
Starts this loader
| MultiLoader | ||
| Constant | Defined by | ||
|---|---|---|---|
| DEFAULT_LOADER : String = "multiloader_default_loader" [static]
| MultiLoader | ||
| allLoaded | property |
allLoaded:Boolean [read-only]Returns true if all items have completed loading
Implementation public function get allLoaded():Boolean
| connections | property |
public var connections:uint = 4Maximum number of assets (simultaneous connections) that can be downloaded at one time.
| connectionsPerHost | property |
public var connectionsPerHost:uint = 4
| debug | property |
public static var debug:uint = 3Debug level
See also
| failedItems | property |
public var failedItems:ArrayA list of all items which failed to load
| items | property |
public var items:ArrayArray of all added items in loader
| _name | property |
public var _name:StringManaged internally by MultiLoaderManager
| name | property |
name:String [read-only]Returns the MultiLoader instance's name - may only be set when instantiating
Implementation public function get name():String
| onComplete | property |
public var onComplete:FunctionExecuted when all items have completed
| onCompleteParams | property |
public var onCompleteParams:ArrayParameters applied to the onComplete Function.
| onProgress | property |
public var onProgress:FunctionExecuted on every progress event.
| onProgressParams | property |
public var onProgressParams:ArrayParameters applied to the onUpdate Function.
| percentageScale | property |
public static var percentageScale:uint = 1What the loading percentages are returned as If this is set to 100 then you'll get back an actual percent If this is set to 1 then you'll get back a value between 0-1
| preventCaching | property |
public static var preventCaching:BooleanDefault setting for whether files should prevent caching May be overridden by the item itself
See also
| retries | property |
public static var retries:uint = 3Default setting for how many retries files should try in the event of a failure May be overridden by the item itself
See also
| startTime | property |
public var startTime:uintWhen the loader is started
| MultiLoader | () | constructor |
public function MultiLoader(flag:Boolean = false)
This is the MultiLoader constructor, but it's not for access outside the MultiLoader library
Instead use MultiLoader.getLoader(name), eg:
var ml : MultiLoader = MultiLoader.getLoader("my_loader");
flag:Boolean (default = false) |
See also
| add | () | method |
public function add(path:String, type:String = "", props:Object = null, params:Object = null):MultiLoaderItemFor adding an item to the loader
Parameterspath:String — The path to the resource - may be relative or absolute
|
|
type:String (default = "") — The type of asset to load. Not required but it is strongly advised to use this.
If not then MultiLoader will attempt to guess what the file type is, defaulting to text
|
|
props:Object (default = null) — An object containing the specific properties for this item. If the MultiLoaderItem
returned by this function is cast to the appropriate type, eg MultiLoaderImageItem then these properties
may be set using strong typing.
|
|
params:Object (default = null) |
MultiLoaderItem —
The MultiLoaderItem instance that has been created.
|
See also
| addItem | () | method |
public function addItem(item:MultiLoaderItem):voidAdds an item directly to this loader
Parametersitem:MultiLoaderItem — The MultiLoaderItem to add
|
| dispose | () | method |
public function dispose():voidDisposes this MultiLoader instance
| forceImmediateLoad | () | method |
public function forceImmediateLoad(key:*):voidOnce an item has been added, it may be forced into the queue immediately using this method which, if all connections are being used, removes the item with the lowest priority from the queue
Parameterskey:* |
| getContent | () | method |
public function getContent(key:*, clearMemory:Boolean = false):*Returns a MultiLoaderItem's content from its key. The content is untyped, so should be cast as appropriate
Parameterskey:* — The key for the item to retrieve
|
|
clearMemory:Boolean (default = false) — Whether or not to delete the item from memory after retrieving it
|
* |
See also
| getItem | () | method |
public function getItem(key:*):MultiLoaderItemReturns a MultiLoaderItem from its key
Parameterskey:* |
MultiLoaderItem |
| getLoader | () | method |
public static function getLoader(name:String):MultiLoaderThe way to instantiate a new MultiLoader instance, or retrieve one which has already been created If the name is already in use, then that loader will be returned, otherwise a new instance will be created. Usage: var ml : MultiLoader = MultiLoader.getLoader("my_loader");
Parametersname:String |
MultiLoader |
| getParams | () | method |
public function getParams(key:*):ObjectReturns a MultiLoaderItem's params from its key
Parameterskey:* |
Object — The params property as an Object, or null if not set
|
See also
| pause | () | method |
public function pause():voidPauses all items so no loading takes place Any items which were partially loaded may or may not lose the bytes loaded so far, depending on the browser being used
See also
| remove | () | method |
public function remove(key:*):BooleanRemove a single item from this loader
Parameterskey:* |
Boolean |
| removeAll | () | method |
public function removeAll():voidRemoves all items from this loader
| removeItem | () | method |
public function removeItem(evt:MultiLoaderEvent):voidCleans up after an item has been removed
Parametersevt:MultiLoaderEvent |
| resume | () | method |
public function resume():voidResumes all paused items Any items which were partially loaded may have to start loading from scratch, depending on the browser being used
See also
| start | () | method |
public function start():voidStarts this loader
| DEFAULT_LOADER | constant |
public static const DEFAULT_LOADER:String = "multiloader_default_loader"