LoadItem
| Kind of class: | public class |
|---|---|
| Package: | org.casalib.load |
| Inherits from: | Process < RemovableEventDispatcher < EventDispatcher |
| Known subclasses: | |
| Version: | 05/30/09 |
| Author: | Aaron Clinger |
| Classpath: | org.casalib.load.LoadItem |
| File last modified: | Sunday, 06 September 2009, 09:33:23 |
Base class used by load classes. LoadItem is not designed to be used on its own and needs to be extended to function.
Events broadcasted to listeners:
- LoadEvent with type:
START- Dispatched when a load is started. - LoadEvent with type:
STOP- Dispatched if the load is stopped during the loading process. - RetryEvent with type:
RETRY- Dispatched if the download attempt failed and the class is going to attempt to download the file again. - IOErrorEvent with type:
IO_ERROR- Dispatched if requested file cannot be loaded and the download terminates. - Event with type:
OPEN- Dispatched when a load operation starts. - LoadEvent with type:
PROGRESS- Dispatched as data is received during the download process. - LoadEvent with type:
COMPLETE- Dispatched when file has completely loaded.
Summary
Constructor
- LoadItem (load:*, request:*)
- Defines the load object and file location.
Class properties
Class properties inherited from Process
Instance properties
- preventCache : Boolean
- Specifies if a random value name/value pair should be appended to the query string to help prevent caching true, or not append false; defaults to false.
- bytesTotal : Number
- The total number of bytes of the requested file.
- bytesLoaded : uint
- The number of bytes loaded of the requested file.
- progress : Percent
- The percent that the requested file has loaded.
- attempts : uint
- The number of additional times the file has attempted to load after start was called.
- retries : uint
- The number of additional load retries the class should attempt before failing; defaults to 2 additional retries / 3 total load attempts.
- urlRequest : URLRequest
- The URLRequest reference to the requested file.
- url : String
- The URL of the requested file.
- loading : Boolean
- Determines if the requested file is loading true, or if it isn't currently loading false.
- loaded : Boolean
- Determines if the requested file has loaded true, or hasn't finished loading false.
- Bps : int
- The current download speed of the requested file in bytes per second.
- time : uint
- The current time duration in milliseconds the load has taken.
- latency : uint
- The time in milliseconds that the server took to respond.
- httpStatus : uint
- The HTTP status code returned by the server; or 0 if no status has/can been received or the load is a stream.
Instance properties inherited from Process
Instance properties inherited from RemovableEventDispatcher
Instance methods
- start : void
- Begins the loading process.
- stop : void
- Cancels the currently loading file from completing.
- destroy : void
Instance methods inherited from RemovableEventDispatcher
Constructor
LoadItem
public function LoadItem (
load:*,
request:*)
Defines the load object and file location.
Parameters:
load :
The load object.
request:
A String or an URLRequest reference to the file you wish to load.
Throws:
- ArguementTypeError if you pass a value type other than a String or URLRequest to parameter
request.
Instance properties
attempts
public attempts:uint
(read)
The number of additional times the file has attempted to load after start was called.
Bps
public Bps:int
(read)
The current download speed of the requested file in bytes per second.
bytesLoaded
public bytesLoaded:uint
(read)
The number of bytes loaded of the requested file.
bytesTotal
public bytesTotal:Number
(read)
The total number of bytes of the requested file.
httpStatus
public httpStatus:uint
(read)
The HTTP status code returned by the server; or
0 if no status has/can been received or the load is a stream. latency
public latency:uint
(read)
The time in milliseconds that the server took to respond.
loaded
public loaded:Boolean
(read)
Determines if the requested file has loaded
true, or hasn't finished loading false. loading
public loading:Boolean
(read)
Determines if the requested file is loading
true, or if it isn't currently loading false. preventCache
public preventCache:Boolean
(read,write)
Specifies if a random value name/value pair should be appended to the query string to help prevent caching
true, or not append false; defaults to false. retries
public retries:uint
(read,write)
The number of additional load retries the class should attempt before failing; defaults to
2 additional retries / 3 total load attempts. time
public time:uint
(read)
The current time duration in milliseconds the load has taken.
url
public url:String
(read)
The URL of the requested file.
urlRequest
public urlRequest:URLRequest
(read)
The URLRequest reference to the requested file.
Instance methods
start
override public function start (
) : void
Begins the loading process.
Events broadcasted to listeners:
- LoadEvent with type:
START- Dispatched when a load is started.
Overrides:
stop
override public function stop (
) : void
Cancels the currently loading file from completing.
Events broadcasted to listeners:
- LoadEvent with type:
STOP- Dispatched if the load is stopped during the loading process.
Overrides: