Package | flare.system |
Class | public class Library3D |
Inheritance | Library3D ![]() |
Implements | ILibraryExternalItem |
Property | Defined By | ||
---|---|---|---|
allowEventsAfterComplete : Boolean
Allow to fire events (progress and complete) after the first complete event were dispatched. | Library3D | ||
bytesLoaded : uint [read-only]
Returns the amount of bytes loaded. | Library3D | ||
bytesTotal : uint [read-only]
Returns the amount of bytes that will be loaded. | Library3D | ||
items : Vector.<ILibraryItem> [read-only]
Returns a copy of the stored items. | Library3D | ||
loaded : Boolean [read-only] | Library3D | ||
progress : Number [read-only]
Returns the global progress of all the resources being currently loaded. | Library3D |
Method | Defined By | ||
---|---|---|---|
Library3D(connections:int = 2, autoStart:Boolean = true, allowEventsAfterComplete:Boolean = true)
Creates a new library object. | Library3D | ||
addItem(path:String, item:ILibraryItem):void
Adds a new item to the library. | Library3D | ||
close():void
Closes all connections. | Library3D | ||
dispose():void
Eliminates cached resources. | Library3D | ||
getItem(path:String):ILibraryItem
Returns an item instance previosuly associated to a path. | Library3D | ||
load():void
Start downloading. | Library3D | ||
Loads a new item object. | Library3D | ||
reset():void
Removes all items and clean all references. | Library3D |
Event | Summary | Defined By | ||
---|---|---|---|---|
This event occurs once the loading process of all the library elements has been completed. | Library3D | |||
Dispatched if a call to load() results in a fatal error that terminates the download. | Library3D | |||
This event occurs whenever the loading progress of the elements of a library is modified. | Library3D | |||
This event occurs when the library has been updated. | Library3D |
allowEventsAfterComplete | property |
allowEventsAfterComplete:Boolean
Allow to fire events (progress and complete) after the first complete event were dispatched. It can be used to load multiple packages.
public function get allowEventsAfterComplete():Boolean
public function set allowEventsAfterComplete(value:Boolean):void
bytesLoaded | property |
bytesLoaded:uint
[read-only] Returns the amount of bytes loaded.
public function get bytesLoaded():uint
bytesTotal | property |
bytesTotal:uint
[read-only] Returns the amount of bytes that will be loaded.
public function get bytesTotal():uint
items | property |
items:Vector.<ILibraryItem>
[read-only] Returns a copy of the stored items.
public function get items():Vector.<ILibraryItem>
loaded | property |
loaded:Boolean
[read-only] public function get loaded():Boolean
progress | property |
progress:Number
[read-only] Returns the global progress of all the resources being currently loaded. Once the 'complete' event has been received, it will be set back to zero and a new progress stage will begin if new resources are loaded only if allowEventsAfterComplete is seted to true in the class constructor,
public function get progress():Number
Library3D | () | Constructor |
public function Library3D(connections:int = 2, autoStart:Boolean = true, allowEventsAfterComplete:Boolean = true)
Creates a new library object.
Parametersconnections:int (default = 2 ) — The number of connections used for download at the same time.
| |
autoStart:Boolean (default = true ) — Define if the library starts automatically to download the files when the first file is added.
| |
allowEventsAfterComplete:Boolean (default = true ) — Allow to fire events (progress and complete) after the first complete events. It can be used to load multiple packages.
|
addItem | () | method |
public function addItem(path:String, item:ILibraryItem):void
Adds a new item to the library. This method asociates the item instance to a key-path to be used with the getItem() method. Also adds the item to a collecion of items.
Parameters
path:String — Path or key to associate the item.
| |
item:ILibraryItem — The item instance.
|
See also
close | () | method |
public function close():void
Closes all connections.
dispose | () | method |
public function dispose():void
Eliminates cached resources.
getItem | () | method |
public function getItem(path:String):ILibraryItem
Returns an item instance previosuly associated to a path.
Parameters
path:String — Path of the item instance.
|
ILibraryItem — The item corresponding to the path, null othwrwise.
|
See also
load | () | method |
public function load():void
Start downloading. If autoStart propery was seted to true in the constructor, this method will be automatically called when loads the first file.
push | () | method |
public function push(item:ILibraryExternalItem):ILibraryExternalItem
Loads a new item object. If the item can not be loaded inmediately (depending of the amount of available connections), it will be added to a queue to be load when connections are available.
Parameters
item:ILibraryExternalItem |
ILibraryExternalItem — true if was sucesful, false otherwise.
|
reset | () | method |
public function reset():void
Removes all items and clean all references.
complete | Event |
flash.events.Event
flash.events.Event
This event occurs once the loading process of all the library elements has been completed.
ioError | Event |
flash.events.IOErrorEvent
flash.events.IOErrorEvent.IO_ERROR
Dispatched if a call to load() results in a fatal error that terminates the download.
progress | Event |
flash.events.ProgressEvent
flash.events.Event
This event occurs whenever the loading progress of the elements of a library is modified.
updated | Event |
flash.events.Event
flash.events.Event
This event occurs when the library has been updated.