| Package | com.acleveraddress.net.multi_loader.items |
| Class | public class MultiLoaderItem |
| Inheritance | MultiLoaderItem AbstractDisplay flash.display.Sprite |
| Subclasses | MultiLoaderImageItem, MultiLoaderSoundItem, MultiLoaderSWFItem, MultiLoaderTextItem, MultiLoaderVideoItem |
var item : MultiLoaderItem = ml.add("http://www.my_site.com/my_image.jpg", MultiLoaderTypes.IMAGE, {key: 'MyItem'});
var item : MultiLoaderImageItem = ml.add("http://www.my_site.com/my_image.jpg", MultiLoaderTypes.IMAGE, {key: 'MyItem'}) as MultiLoaderImageItem;
var image : MultiLoaderImageItem = new MultiLoaderImageItem("http://www.my_site.com/my_image.jpg", MultiLoaderTypes.IMAGE, {key: 'MyItem'};
ml.addItem(image);
var image : MultiLoaderImageItem = new MultiLoaderImageItem("http://www.my_site.com/my_image.jpg", MultiLoaderTypes.IMAGE);
image.key = "MyItem";
image.applicationDomain = myApplicationDomain;
ml.addItem(image);
| Item type | Returns |
|---|---|
| MultiLoaderImageItem | Bitmap |
| MultiLoaderSoundItem | Sound |
| MultiLoaderSWFItem | MovieClip |
| MultiLoaderTextItem | String |
| MultiLoaderVideoItem | NetStream |
| MultiLoaderXMLItem | XML |
See also
| Property | Defined by | ||
|---|---|---|---|
| attempts : uint [read-only]
| MultiLoaderItem | ||
| bytesLoaded : Number [read-only]
| MultiLoaderItem | ||
| bytesTotal : Number [read-only]
| MultiLoaderItem | ||
| content : * [read-only]
When the asset is loaded the content is set to the loaded item
| MultiLoaderItem | ||
| context : LoaderContext
The LoaderContext to be used, if necessary
| MultiLoaderItem | ||
| elapsedTime : uint [read-only]
| MultiLoaderItem | ||
| endTime : uint [read-only]
| MultiLoaderItem | ||
| errorMessage : String
In the event of an error, this is set to the error message
| MultiLoaderItem | ||
| hasFailed : Boolean [read-only]
| MultiLoaderItem | ||
| headers : Array
The array of headers to be sent with the request
| MultiLoaderItem | ||
| hostName : String [read-only]
| MultiLoaderItem | ||
| index : uint [read-only]
| MultiLoaderItem | ||
| isLoaded : Boolean [read-only]
| MultiLoaderItem | ||
| isLoading : Boolean [read-only]
| MultiLoaderItem | ||
| key : *
The key used to reference the item.
| MultiLoaderItem | ||
| originalPath : String
This is set to the original path, for use if preventCaching is being used
as well as a key, so that the original path may still be used to return
the item
| MultiLoaderItem | ||
| params : Object
The params object is for saving associated parameters into the loader item when you first
create it, so that you may retrieve them later, so you don't need to reference the creation
source again once it has loaded, eg
var item : MultiLoaderItem = ml.add(imageXML.source, {key: 'img_1');
item.params = {width: imageXML.width, height: imageXML.height};
ml.start();
... | MultiLoaderItem | ||
| path : String
The path to the resource - may be relative or absolute
| MultiLoaderItem | ||
| percentLoaded : Number [read-only]
| MultiLoaderItem | ||
| preventCaching : Boolean
Whether this item should enforce a fresh load (true) or if it tries to load a
cached version.
| MultiLoaderItem | ||
| priority : int
The priority of this item - set to 0 by default
| MultiLoaderItem | ||
| retries : uint
How many times the loader should attempt to load the item after a failure.
| MultiLoaderItem | ||
| startTime : uint [read-only]
| MultiLoaderItem | ||
| type : String
The type of asset to load.
| MultiLoaderItem | ||
| urlRequest : URLRequest
The URLRequest created for the loading request if necessary
| MultiLoaderItem | ||
| weight : uint = 1
The loading weight to be used for analysing the loader's progress
| MultiLoaderItem | ||
| Property | Defined by | ||
|---|---|---|---|
| nameToString : String [read-only]
| MultiLoaderItem | ||
| Method | Defined by | ||
|---|---|---|---|
|
MultiLoaderItem(path:String, type:String, props:Object = null, params:Object = null)
Create a new MultiLoaderItem
| MultiLoaderItem | ||
|
dispose():void
Disposes of this item
| MultiLoaderItem | ||
|
init():void
Called when the item has been added to the loader
| MultiLoaderItem | ||
|
load():void
Starts the item loading
| MultiLoaderItem | ||
|
onStarted():void
| MultiLoaderItem | ||
|
stopLoad():void
Stops the item from loading
| MultiLoaderItem | ||
| Method | Defined by | ||
|---|---|---|---|
![]() |
added(evt:Event):void
| AbstractDisplay | |
![]() |
addEvent(item:EventDispatcher, type:String, listener:Function, weakReference:Boolean = true, priority:int = 0):void
| AbstractDisplay | |
|
addListeners(item:EventDispatcher):void
| MultiLoaderItem | ||
|
completeHandler(evt:Event = null):void
| MultiLoaderItem | ||
|
httpStatusHandler(event:HTTPStatusEvent):void
| MultiLoaderItem | ||
|
ioErrorHandler(event:IOErrorEvent):void
| MultiLoaderItem | ||
|
loadingFailed(error:String):void
| MultiLoaderItem | ||
|
openHandler(event:Event):void
| MultiLoaderItem | ||
|
progressHandler(event:ProgressEvent):void
| MultiLoaderItem | ||
![]() |
removed(evt:Event):void
| AbstractDisplay | |
![]() |
removeEvent(item:EventDispatcher, type:String, listener:Function):void
| AbstractDisplay | |
![]() |
removeIfExists(child:DisplayObject, container:DisplayObjectContainer):void
| AbstractDisplay | |
|
removeListeners(item:EventDispatcher):void
| MultiLoaderItem | ||
![]() |
resize(evt:Event = null):void
| AbstractDisplay | |
|
securityErrorHandler(event:SecurityErrorEvent):void
| MultiLoaderItem | ||
| attempts | property |
attempts:uint [read-only]Implementation
public function get attempts():uint
| bytesLoaded | property |
bytesLoaded:Number [read-only]Implementation
public function get bytesLoaded():Number
| bytesTotal | property |
bytesTotal:Number [read-only]Implementation
public function get bytesTotal():Number
| content | property |
content:* [read-only]When the asset is loaded the content is set to the loaded item
Implementation public function get content():*
| context | property |
public var context:LoaderContextThe LoaderContext to be used, if necessary
| elapsedTime | property |
elapsedTime:uint [read-only]Implementation
public function get elapsedTime():uint
| endTime | property |
endTime:uint [read-only]Implementation
public function get endTime():uint
| errorMessage | property |
public var errorMessage:StringIn the event of an error, this is set to the error message
| hasFailed | property |
hasFailed:Boolean [read-only]Implementation
public function get hasFailed():Boolean
See also
| headers | property |
public var headers:ArrayThe array of headers to be sent with the request
| hostName | property |
hostName:String [read-only]Implementation
public function get hostName():String
| index | property |
index:uint [read-only]Implementation
public function get index():uint
| isLoaded | property |
isLoaded:Boolean [read-only]Implementation
public function get isLoaded():Boolean
| isLoading | property |
isLoading:Boolean [read-only]Implementation
public function get isLoading():Boolean
| key | property |
public var key:*The key used to reference the item. If not set explicitly, the path is used
| nameToString | property |
nameToString:String [read-only]Implementation
protected function get nameToString():String
| originalPath | property |
public var originalPath:StringThis is set to the original path, for use if preventCaching is being used as well as a key, so that the original path may still be used to return the item
| params | property |
public var params:Object
The params object is for saving associated parameters into the loader item when you first
create it, so that you may retrieve them later, so you don't need to reference the creation
source again once it has loaded, eg
var item : MultiLoaderItem = ml.add(imageXML.source, {key: 'img_1');
item.params = {width: imageXML.width, height: imageXML.height};
ml.start();
...
(onComplete function...)
var bmp : Bitmap = ml.getContent('img_1') as Bitmap;
bmp.width = ml.getParams('img_1').width;
bmp.height = ml.getParams('img_1').height;
| path | property |
public var path:StringThe path to the resource - may be relative or absolute
| percentLoaded | property |
percentLoaded:Number [read-only]Implementation
public function get percentLoaded():Number
See also
| preventCaching | property |
public var preventCaching:BooleanWhether this item should enforce a fresh load (true) or if it tries to load a cached version. Default is set by MultiLoader.preventCaching
See also
| priority | property |
public var priority:intThe priority of this item - set to 0 by default
| retries | property |
public var retries:uint
How many times the loader should attempt to load the item after a failure.
Default is set by MultiLoader.retries
See also
| startTime | property |
startTime:uint [read-only]Implementation
public function get startTime():uint
| type | property |
public var type:StringThe type of asset to load. Not required but it is strongly advised to use this. If not supplied then MultiLoader will attempt to ascertain the file type, defaulting to text
| urlRequest | property |
public var urlRequest:URLRequestThe URLRequest created for the loading request if necessary
| weight | property |
public var weight:uint = 1The loading weight to be used for analysing the loader's progress
See also
| MultiLoaderItem | () | constructor |
public function MultiLoaderItem(path:String, type:String, props:Object = null, params:Object = null)Create a new MultiLoaderItem
Parameterspath:String — The path to the resource - may be relative or absolute
|
|
type:String — 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) |
| addListeners | () | method |
protected function addListeners(item:EventDispatcher):voidParameters
item:EventDispatcher |
| completeHandler | () | method |
protected function completeHandler(evt:Event = null):voidParameters
evt:Event (default = null) |
| dispose | () | method |
public function dispose():voidDisposes of this item
| httpStatusHandler | () | method |
protected function httpStatusHandler(event:HTTPStatusEvent):voidParameters
event:HTTPStatusEvent |
| init | () | method |
public function init():voidCalled when the item has been added to the loader
| ioErrorHandler | () | method |
protected function ioErrorHandler(event:IOErrorEvent):voidParameters
event:IOErrorEvent |
| load | () | method |
public function load():voidStarts the item loading
| loadingFailed | () | method |
protected function loadingFailed(error:String):voidParameters
error:String |
| onStarted | () | method |
public function onStarted():void
| openHandler | () | method |
protected function openHandler(event:Event):voidParameters
event:Event |
| progressHandler | () | method |
protected function progressHandler(event:ProgressEvent):voidParameters
event:ProgressEvent |
| removeListeners | () | method |
protected function removeListeners(item:EventDispatcher):voidParameters
item:EventDispatcher |
| securityErrorHandler | () | method |
protected function securityErrorHandler(event:SecurityErrorEvent):voidParameters
event:SecurityErrorEvent |
| stopLoad | () | method |
public function stopLoad():voidStops the item from loading