LoadItem

Kind of class:public class
Package:org.casalib.load
Inherits from:BaseLoadItem < Process < RemovableEventDispatcher < EventDispatcher
Known subclasses:
Version:11/05/08
Author:Aaron Clinger
Classpath:org.casalib.load.LoadItem
File last modified:Tuesday, 20 January 2009, 15:37:04
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.
  • 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 : uint
    • 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 times the file has attempted to load after start was called.
  • retries : uint
    • The number of additional load retires the class should attempt before failing; defaults to 2 additional retries / 3 total load attempts.
  • urlRequest : URLRequest
    • The URLRequest reference to the requested file.
  • 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.
Instance properties inherited from BaseLoadItem
Instance methods
  • start : void
    • Begins the loading process.
  • stop : void
    • Cancels the currently loading file from completing.
  • destroy : void

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 times the file has attempted to load after start was called.

Bps

override 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:uint
(read)

The total number of bytes of the requested file.

loaded

override public loaded:Boolean
(read)

Determines if the requested file has loaded true, or hasn't finished loading false.

preventCache

override 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.

progress

override public progress:Percent
(read)

The percent that the requested file has loaded.

retries

public retries:uint
(read,write)

The number of additional load retires the class should attempt before failing; defaults to 2 additional retries / 3 total load attempts.

urlRequest

public urlRequest:URLRequest
(read)

The URLRequest reference to the requested file.

Instance methods

destroy

override public function destroy (
) : void

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: