Packagecom.acleveraddress.net.multi_loader
Classpublic class MultiLoaderManager
InheritanceMultiLoaderManager Inheritance AbstractMultiLoaderManager

A collection of static methods which help manage new and exisiting loaders, and returns loading data for all items in a specific loader instance

As this information is always returned in the progress event, it shouldn't really be necessary to access this directly.

When loading an item, ActionScript has no idea what the total file size is until it has started downloading, which means that the bytes total cannot be worked out until the last file has begun downloading

To get around this, there are options to monitor progress by weight or ratio instead

With ratio, each file is treated as one unit, so if, for example you were loading two files:
- file_a is 1000 bytes
- file_b is 4000 bytes
Then if file_a has loaded and file_b hasn't, the loader will report that 1 out of 2 (50%) has been loaded, even though the actual progress is only 20%

Weight is similar to ratio, except you can specify the units for each (the default is 1)
Using the example of the files above, then imagine:
- file_a has its weight set to 1, and
- file_b has its weight set to 4

then the total weight is 5 (1 + 4), so when file_a has loaded and file_b has not, then the loader reports that 1 out of 5 (20%) has been loaded, which is correct.
Theoretically, you could find all the required file sizes out before loading, and set the weights for all items perfectly accurately, but that can be quite a lot of effort, so often a rough guess will be used, eg A big video file might have a weight of 10, while a small XML file could be .5

See also

com.research_now.net.multi_loader.events.MultiLoaderProgressEvent


Public Properties
 PropertyDefined by
  _loaders : Dictionary
[static]
MultiLoaderManager
  loaders : Dictionary
[static][read-only]
MultiLoaderManager
  _loadersLength : uint
[static]
MultiLoaderManager
  loadersLength : uint
[static][read-only]
MultiLoaderManager
Public Methods
 MethodDefined by
  
bytesLoaded(loader:MultiLoader):Number
[static]
MultiLoaderManager
  
bytesTotal(loader:MultiLoader):Number
[static]
MultiLoaderManager
  
dispose():void
MultiLoaderManager
  
failedItems(loader:MultiLoader):Array
[static]
MultiLoaderManager
  
loadedItems(loader:MultiLoader):Array
[static]
MultiLoaderManager
  
loadingItems(loader:MultiLoader):Array
[static]
MultiLoaderManager
  
pendingItems(loader:MultiLoader):Array
[static]
MultiLoaderManager
  
ratioLoaded(loader:MultiLoader):Number
[static] The ratio loaded is an overall percentage of what has loaded, acting as if every item is the same size, so if 6 out of 10 items have loaded then this will return 60%, even if the remaining 4 items are much larger
MultiLoaderManager
  
ratioTotal(loader:MultiLoader):Number
[static] The ratio loaded is an overall percentage of what has loaded, acting as if every item is the same size, so if 6 out of 10 items have loaded then this will return 60%, even if the remaining 4 items are much larger
MultiLoaderManager
  
[static]
MultiLoaderManager
  
weightLoaded(loader:MultiLoader):Number
[static] Returns the overall weight loaded for all current loaders
MultiLoaderManager
  
weightTotal(loader:MultiLoader):Number
[static] Returns the overall weight total for all current loaders
MultiLoaderManager
Protected Methods
 MethodDefined by
 Inherited
hasFailed(element:MultiLoaderItem, ... args):Boolean
[static]
AbstractMultiLoaderManager
 Inherited
isLoaded(element:MultiLoaderItem, ... args):Boolean
[static]
AbstractMultiLoaderManager
 Inherited
isLoading(element:MultiLoaderItem, ... args):Boolean
[static]
AbstractMultiLoaderManager
 Inherited
isPending(element:MultiLoaderItem, ... args):Boolean
[static]
AbstractMultiLoaderManager
Property detail
_loadersproperty
public static var _loaders:Dictionary
loadersproperty 
loaders:Dictionary  [read-only]

Implementation
    public static function get loaders():Dictionary
_loadersLengthproperty 
public static var _loadersLength:uint
loadersLengthproperty 
loadersLength:uint  [read-only]

Implementation
    public static function get loadersLength():uint
Method detail
bytesLoaded()method
public static function bytesLoaded(loader:MultiLoader):Number

Parameters
loader:MultiLoader — A MultiLoader instance

Returns
Number — The total number of bytes loaded so far in the specified loader
bytesTotal()method 
public static function bytesTotal(loader:MultiLoader):Number

Parameters
loader:MultiLoader — A MultiLoader instance

Returns
Number — The total number of bytes to be loaded, or 0 if the total is not yet known (ie not all items have started loading
dispose()method 
public function dispose():void
failedItems()method 
public static function failedItems(loader:MultiLoader):Array

Parameters
loader:MultiLoader

Returns
Array — A list of all failed items
loadedItems()method 
public static function loadedItems(loader:MultiLoader):Array

Parameters
loader:MultiLoader

Returns
Array — A list of all loaded items
loadingItems()method 
public static function loadingItems(loader:MultiLoader):Array

Parameters
loader:MultiLoader

Returns
Array — A list of all loading items
pendingItems()method 
public static function pendingItems(loader:MultiLoader):Array

Parameters
loader:MultiLoader

Returns
Array — A list of all pending items
ratioLoaded()method 
public static function ratioLoaded(loader:MultiLoader):Number

The ratio loaded is an overall percentage of what has loaded, acting as if every item is the same size, so if 6 out of 10 items have loaded then this will return 60%, even if the remaining 4 items are much larger

Parameters
loader:MultiLoader — A MultiLoader instance

Returns
Number — The total number of bytes loaded so far
ratioTotal()method 
public static function ratioTotal(loader:MultiLoader):Number

The ratio loaded is an overall percentage of what has loaded, acting as if every item is the same size, so if 6 out of 10 items have loaded then this will return 60%, even if the remaining 4 items are much larger

Parameters
loader:MultiLoader — A MultiLoader instance

Returns
Number — The total expected size of the combined ratios (allItems - failedItems)
removeLoader()method 
public static function removeLoader(loader:MultiLoader):voidParameters
loader:MultiLoader
weightLoaded()method 
public static function weightLoaded(loader:MultiLoader):Number

Returns the overall weight loaded for all current loaders

Parameters
loader:MultiLoader — A MultiLoader instance

Returns
Number — The weight loaded
weightTotal()method 
public static function weightTotal(loader:MultiLoader):Number

Returns the overall weight total for all current loaders

Parameters
loader:MultiLoader — A MultiLoader instance

Returns
Number — The weight total