LoadItem

Manages the tracking, progress, and reporting for a single binary/data load.  This is a more advanced version of a URLLoader or URLStream instance in that all (or most) valid Flash data types, whether binary or text-based, are supported and automatically generated upon load completion.  A load of an external SWF or JPEG file, for example, is handled exactly the same way as the load of an XML document.  This provides centralized manageability for loads as well as allowing data to be intercepted and manipulated (for example, decrypted) before being used.

__/ REQUIREMENTS \__

ActionScript 3.0 (or later)

__/ IMPORTS \__

com.bnm.api.instances.ErrorBroadcast com.bnm.api.instances.XMLs com.bnm.api.instances.FIFOBuffer flash.display.* flash.media.Sound flash.net.* flash.events.* flash.utils.ByteArray flash.utils.getTimer com.bnm.api.ThreadManager com.bnm.api.instances.TimeObject com.bnm.api.instances.Thread

__/ EXTENDS \__

com.bnm.api.ThreadManager

__/ IMPLEMENTS \__

nothing

__/ NOTICE \__

©opyright 2008 Bay New Media.  All rights, as stipulated in the The MIT License, are reserved.

This ActionScript library is licensed and released under the MIT License (http://www.opensource.org/licenses/mit-license.php).  Please refer to the accompanying text file “license.txt”, which should be distributed with every package and version of this library, for information on usage, distribution, copying, and other important information.

Please visit http://www.baynewmedia.com/ or email con.nosp@m.tact@baynewm.nosp@m.edia.com for information, questions, concerns, or bug reports.

__/ NOTES \__

This class is commented using the NaturalDocs documentation system.  It is intended to be easily read both from the direct source code and from an adaptation that is generated as hyperlinked HTML.  The NaturalDocs specification used in this class’ documentation is version 1.35 though older versions may probably be used safely.  For more information, please visit: http://www.naturaldocs.org/

The BNMAPI is officially available (primary sources) on Source Forge (http://sourceforge.net/projects/bnmapi/), on the Bay New Media site (http;//www.baynewmedia.com/), on the PeaBee project site (http://www.peabee.com/), and through the Bay New Media SVM repository server (visit http://www.baynewmedia.com/ for more information).  Downloads from other sources may not be complete or up-to-date.

If you’re interested in joining the BNMAPI project in any capacity (development, testing, distribution, etc.), please visit us on Source Forge or the Bay New Media web site.

Summary
LoadItemManages the tracking, progress, and reporting for a single binary/data load.
Constants
ZLIB_HEADER(String) The three byte signature that identifies a ZLIB compressed file.
GIF_Header(String) The three byte signature that identifies a GIF89s image file.
JPEG_Header(String) The three byte signature that identifies a JPEG image file.
Variables
_content(untyped) The object or instance into which loaded data will placed in its final, converted state.
_type(String) Defines the target daa type to which to convert the loaded data stored in the _content property.
_method(String) The server submission method to use when sendind data to the server.
_request(URLRequest) An instance of the <URLRequest> class used to build the request object during send/load operations.
_stream(URLStream) An instance of the <URLStream> class used to stream data from the server or local file.
_trackingObject(Object) Object used to track the progress of the current load, including calculations on average load speeds, etc.
_buffer(ByteArray) Used to stora raw binary data as it’s loading and after the load completes.
_fastBuffer(Boolean) If TRUE, the fast buffering mechanism is used to allow reading of data at a faster interval.
_fastBufferThread(Thread) A Thread instance used for monitoring the buffer during fast buffering operations.
_FIFOBuffer(FIFOBuffer) An optional <FIFOBuffer> instance to be used with this load.
_loader(Loader) An instance of the <Loader> class used to dynamically create display objects from a <ByteArray> once it’s been loaded from the stream.
Functions and Properties
LoadItemConstructor method for the class.
startAttempts to start the load operation.
onProgressInvoked by Flash on any <ProgressEvent> event for the associated load item.
onSoundProgressTrackes the progress of a <Sound> instance via <ProgressEvent> broadcasts.
updateFastBufferUpdates the internal fast buffer which is read on a regular interval, as opposed to the standard progress event broadcast whenever a block of data is read.
onLoadCompleteInvoked via a standard <Event> event whenever a load operation successfully completes.
onHTTPStatusInvoked via a standard <HTTPStatusEvent> event whenever a load operation reports an HTTP status (404, 200, etc.)
onSecurityErrorInvoked via a standard <SecurityErrorEvent> event whenever a load operation halts due to a security restriction.
onSecurityErrorInvoked via a standard <IOErrorEvent> event whenever a load operation encounters an input/output error.
onIOError
onReadLoaderBufferThe final step in data conversion (after invoking convertData) for MovieClip, Bitmap, and Sprite types that require a buffer conversion from a ByteArray to a Loader type.
broadcastCompletionEventBroadcasts the “LoadItem.COMPLETE” event when a load is ready to report that it has fully completed.
set pathSets the path (URL or local file reference) from which to load the asset or data from.
path
get pathReturns the path value assigned to this LoadItem instance.
path
get contentReturns the content object instance into which the data or asset is to be, or is being, loaded.
content
set contentDummy proprty intercept that reports an error (the _content) property may only be set internally.
content
set typeSpecifies the target content type into which the loaded data should be converted.
type
get typeReturns the type value which will determine how the loaded data will be converted (and therefore the type of the content property).
type
set methodSets the server submission method to use when the load operation submits data.
method
get methodReturns the server submission method currently being used when submitting data to the server.
method
set fastBufferEnables or disables fast buffering for any subsequent load operation (will not affect an active one).
fastBuffer
get fastBufferReturns the state of the fast buffer mechanism.
fastBuffer
set useFIFOBufferAssigns a <FIFOBuffer> instance for use with this load item.
useFIFOBuffer
get useFIFOBufferReturns a <FIFOBuffer> instance for use with this load item.
useFIFOBuffer
set sendDataAssigns any data to be sent to the URL request.
sendData
get sendDataReturns any data assigned to the request object for sending to the server.
sendData
startFastBufferBegins the fast buffer thread used for more accurate updates of the transfer buffer.
stopFastBufferStops the fast buffer execution thread, if running, and cleans up the Thread instance for garbage collection.
convertDataConverts data to the content object type based on the internal _type type.
setDefaultsSets default properties, instances, and values at class instantiation.
setListenersSets event listeners for the class instance/API chain.
setSoundListenersSets event listeners for the class instance/API chain.
removeSoundListenersRemoves event listeners for the Sound object, typically when the load operation completes.

Constants

ZLIB_HEADER

public const ZLIB_HEADER: String

(String) The three byte signature that identifies a ZLIB compressed file.  This signature may be used when reading raw binary data to determine whether or not it’s compressed.

GIF_Header

public const GIF_Header: String

(String) The three byte signature that identifies a GIF89s image file.  This signature may be used when reading raw binary data to determine whether or not it’s a GIF file.

JPEG_Header

public const JPEG_Header: String

(String) The three byte signature that identifies a JPEG image file.  This signature may be used when reading raw binary data to determine whether or not it’s a JPEG file.

Variables

_content

private var _content: *

(untyped) The object or instance into which loaded data will placed in its final, converted state.  The data type of this variable is based on the _type property of the class unless the data can’t be converted to this type (XML data converted into a MovieClip, for example).

_type

private var _type: String

(String) Defines the target daa type to which to convert the loaded data stored in the _content property.  The most universal type is “binary” (default) which will hold any type of data in a native <ByteArray>.  Where possible, data will be converted but this may sometimes cause an error (if XML is loaded, for example, and the `_type` is set to “movieclip”).

_method

private var _method: String

(String) The server submission method to use when sendind data to the server.  If the sendData property hasn’t been set or has been set to NULL when the load begins, the send methos is ignored since no data is available to send.  Valid values for _method include “GET” or “POST” and should be accessed via the included setter/getter methods.

_request

private var _request: URLRequest

(URLRequest) An instance of the <URLRequest> class used to build the request object during send/load operations.  This typically includes the URL/File path, send data (if available), send method (if applicable), and custom request headers (if available).

_stream

private var _stream: URLStream

(URLStream) An instance of the <URLStream> class used to stream data from the server or local file.  This is the instance that actually controls the data transport and a stream is used to provide buffered data access as well as to allow dynamic manipulation of the data.  Unlike other loading methods, loaded data is not assumed to be of a specific type.  Rather, that determination is made based on the <_target> property and automatic conversion is done once all data is loaded.  Note that loads of audio data are treated differently because, as of this version of Flash, dynamic audio data assignment is not yet supported.  This may change in future revisions (eg.  Flash Player 10).

_trackingObject

private var _trackingObject: Object

(Object) Object used to track the progress of the current load, including calculations on average load speeds, etc.

_buffer

private var _buffer: ByteArray

(ByteArray) Used to stora raw binary data as it’s loading and after the load completes.  This data is typically converted to the target data type/object but it may also be read directly to be manipulated or examined directly.

_fastBuffer

private var _fastBuffer: Boolean

(Boolean) If TRUE, the fast buffering mechanism is used to allow reading of data at a faster interval.  If FALSE (default), fast buffering is disabled.  Setter and getter are provided.

_fastBufferThread

private var _fastBufferThread: Thread

(Thread) A Thread instance used for monitoring the buffer during fast buffering operations.  The fast buffer thread is only used if the _fastBuffer valus is TRUE at the time when the load is started.

_FIFOBuffer

private var _FIFOBuffer: FIFOBuffer

(FIFOBuffer) An optional <FIFOBuffer> instance to be used with this load.  The FIFO buffer controls load ordering (since loads often complete asynchronously) but this may be omitted if not required.

_loader

private var _loader: Loader

(Loader) An instance of the <Loader> class used to dynamically create display objects from a <ByteArray> once it’s been loaded from the stream.

Functions and Properties

LoadItem

public function LoadItem ()

Constructor method for the class.

Parameters

none

Returns

LoadItem: An instance of the LoadItem class.

Broadcasts

nothing

Throws

nothing

start

public function start ():void

Attempts to start the load operation.  A number of checks are performed first to ensure that all requred parameters have been set.

Parameters

none

Returns

nothing

Broadcasts

ErrorBroadcast “LoadItem.ERROR” “LoadItem.START”

Throws

nothing

Bubbles

no

onProgress

public function onProgress (eventObj: ProgressEvent):void

Invoked by Flash on any <ProgressEvent> event for the associated load item.  This typically occurs when new data is available to read from the transfer buffer.  Load progress is tracked internally and reported in a variety of ways with a re-broadcast event.

Parameters

eventObj (ProgressEvent, required): A standard <ProgressEvent> object.

Returns

nothing

Broadcasts

LoadItem.PROGRESS

Throws

nothing

Bubbles

no

onSoundProgress

public function onSoundProgress (eventObj: ProgressEvent):void

Trackes the progress of a <Sound> instance via <ProgressEvent> broadcasts.  Sound loads, although reported in the same manner to any listener, are tracked differently within the Flash player.

Parameters

eventObj (ProgressEvent, required): A standard <ProgressEvent> instance.

Returns

nothing

Broadcasts

”LoadItem.PROGRESS”

Throws

nothing

Bubbles

no

updateFastBuffer

public function updateFastBuffer ():void

Updates the internal fast buffer which is read on a regular interval, as opposed to the standard progress event broadcast whenever a block of data is read.  This method, in theory, allows ready of data that is not yet available during a progress event as it is read before the event itself.

Parameters

none

Broadcasts

nothing

Throws

nothing

Bubbles

no

onLoadComplete

public function onLoadComplete (eventObj: Event):void

Invoked via a standard <Event> event whenever a load operation successfully completes.  This does not mean that the loaded daa is yet ready to be used.  With some data types such as Bitmaps and MovieClips, an extra asynchronous step is taken to convert them to their final target.

Parameters

eventObj (Event, required): A standard <Event> instance.

Returns

nothing

Broadcasts

nothing

Throws

nothing

Bubbles

no

See also

convertData

onHTTPStatus

public function onHTTPStatus (eventObj: HTTPStatusEvent):void

Invoked via a standard <HTTPStatusEvent> event whenever a load operation reports an HTTP status (404, 200, etc.)

Parameters

eventObj (HTTPStatusEvent, required): A standard <HTTPStatusEvent> instance.

Returns

nothing

Broadcasts

LoadItem.HTTPSTATUS

Throws

nothing

Bubbles

no

onSecurityError

public function onSecurityError (eventObj: SecurityErrorEvent):void

Invoked via a standard <SecurityErrorEvent> event whenever a load operation halts due to a security restriction.

Parameters

eventObj (SecurityErrorEvent, required): A standard <SecurityErrorEvent> instance.

Returns

nothing

Broadcasts

LoadItem.ERROR

Throws

nothing

Bubbles

no

onSecurityError

Invoked via a standard <IOErrorEvent> event whenever a load operation encounters an input/output error.

Parameters

eventObj (IOErrorEvent, required): A standard <IOErrorEvent> instance.

Returns

nothing

Broadcasts

LoadItem.ERROR

Throws

nothing

Bubbles

no

onIOError

public function onIOError (eventObj: IOErrorEvent):void

onReadLoaderBuffer

public function onReadLoaderBuffer(eventObj: Event):void

The final step in data conversion (after invoking convertData) for MovieClip, Bitmap, and Sprite types that require a buffer conversion from a ByteArray to a Loader type.  Since this is accomplished asynchonously it is invoked via an event.  For other types such as XML, String, ByteArray, and Sound, no further conversion takes place.

Parameters

eventObj (Event, required): A standard <Event> object instance.

Returns

nothing

Broadcasts

nothing

Throws

nothing

See also

convertData

broadcastCompletionEvent

public function broadcastCompletionEvent(... args):void

Broadcasts the “LoadItem.COMPLETE” event when a load is ready to report that it has fully completed.  This method is centralize so that the format of the call may be standardized as well as providing support for FIFOBuffer functionality if it’s being used.  For FIFO buffered loads, “LoadItem.FIFOCOMPLETE” is broadcast instead.

Parameters

fromFIFO (Boolean, optional): Used by the <FIFOBuffer> instance to broadcast a standard completion message.  If TRUE, a standard “LoadItem.COMPLETE” message is broadcast regardless of other settings, otherwise the presence of FIFO buffering is checked first and, if present, a “LoadItem.FIFOCOMPLETE” event is broadcast instead.

Returns

nothing

Broadcasts

LoadItem.COMPLETE LoadItem.FIFOCOMPLETE

Throws

nothing

Bubbles

no

set path

Sets the path (URL or local file reference) from which to load the asset or data from.

Parameter

String: The path, URL or file reference, relative or absolute.

Broadcasts

nothing

Throws

nothing

Bubbles

no

path

public function set path (pathString: String)

get path

Returns the path value assigned to this LoadItem instance.

Returns

String: The path, URL or file reference, relative or absolute, of this instance.

Broadcasts

nothing

Throws

nothing

Bubbles

no

path

public function get path ():String

get content

Returns the content object instance into which the data or asset is to be, or is being, loaded.  Note that this property can’t be assigned since it’s controller internally (it’s therefore read-only).

Returns

untyped: The target object into which the data or asset will be, or is being, loaded.  May be NULL if not yet assigned, otherwise it may be of any type depending on the type of data being loaded.

Broadcasts

nothing

Throws

nothing

Bubbles

no

content

public function get content ():*

set content

Dummy proprty intercept that reports an error (the _content) property may only be set internally.

Parameters

untyped: This property is ignored.

Broadcasts

LoadItem.ERROR

Throws

nothing

Bubbles

no

content

public function set content (val: *)

set type

Specifies the target content type into which the loaded data should be converted.  Valid type include “binary” (also “bin” or “b” or “bytearray” or “byte”), “movieclip” (or “movie” or “swf”), “string” (or “str or “s”), “xml” (or “x”), “xmls” (or “xs”), bitmap (or “bmp”), “sprite” (or “spr”), “sound” (or “snd”), and “shape” (or “shp”).  This value is not case sensitive and if not specified or invalid, “binary” is used.

Parameter

String: The target data type to which to convert the loaded data into and assign to the content property.  Setting this value after a load has completed has no effect.

Broadcasts

nothing

Throws

nothing

Bubbles

no

type

public function set type (typeStr: String)

get type

Returns the type value which will determine how the loaded data will be converted (and therefore the type of the content property).  Possible values are “binary” (default, a <ByteArray> instance), “movieclip” (a <MovieClip> instance), “string” ( a <String> instance), “xml” (an <XML> instance), “xmls” (an XMLs instance), “bitmap” (a <Bitmap> instance), “sprite” (a <Sprite> instance), or “shape” (a <Shape> instance).

Returns

String: The data type to which the loaded data will be converted into and which will assigned to the content property.

Broadcasts

nothing

Throws

nothing

Bubbles

no

type

public function get type():String

set method

Sets the server submission method to use when the load operation submits data.  If the sendData property hasn’t been set or is NULL, the method is ignored since there is no data to submit (so only a load operation takes place).

Parameter

String: The submission method to use when submitting data to the server.  Valid values include “GET” and “POST” (not case sensitive).  If the parameter is invalid or NULL, “GET” is set as default.

Broadcasts

nothing

Throws

nothing

Bubbles

no

method

public function set method (methodString: String)

get method

Returns the server submission method currently being used when submitting data to the server.  This value is only used if sendData has been set, otherwise it will be ignored when the load operation begins.

Returns

String: The submission method to use when submitting data to the server.  Will either be “GET” or “POST”.

Broadcasts

nothing

Throws

nothing

Bubbles

no

method

public function get method ():String

set fastBuffer

Enables or disables fast buffering for any subsequent load operation (will not affect an active one).  Fast buffering uses a Thread instance to monitor the loading buffer more frequently than when using <ProgressEvent> updates and is therefore, in theory, able to read data before update events are broadcast.  Because data is checked and read much more frequently, enabling fast buffering creates more processing and memory overhead during loads, so it should be used sparringly.  This value will not affect loads already in progress so it must be set before calling the start method.

Parameter

Boolean: If TRUE, fast buffering is enabled.  If FALSE, it is disabled.

Broadcasts

nothing

Throws

nothing

Bubbles

no

fastBuffer

public function set fastBuffer (bufferSet: Boolean)

get fastBuffer

Returns the state of the fast buffer mechanism.  If this value was set after a load was started, it may not accurately reflect the state of the fast buffering mechanism.

Returns

Boolean: TRUE if fast buffering is enabled, FALSE otherwise.

Broadcasts

nothing

Throws

nothing

Bubbles

no

fastBuffer

public function get fastBuffer ():Boolean

set useFIFOBuffer

Assigns a <FIFOBuffer> instance for use with this load item.  When FIFOBuffering is enabled in this way, loads are sequenced even though they may be received asynchronously.  That is, loads report completion in the order in which they were created rather than in the order in which they ended (which can often be somewhat random).  See the <com.api.instances.FIFOBuffer> class for more information.

Parameter

FIFOBuffer: A FIFOBuffer instance to assign to this load.  The load instance automatically assigns itself to the <FIFOBuffer> instance as soon as this property is set, thereby assuring proper sequencing.

Broadcasts

nothing

Throws

nothing

Bubbles

no

useFIFOBuffer

public function set useFIFOBuffer (buffer: FIFOBuffer)

get useFIFOBuffer

Returns a <FIFOBuffer> instance for use with this load item.  See the <com.api.instances.FIFOBuffer> class for more information.

Returns

FIFOBuffer: The FIFOBuffer instance to assign to this load, or NULL if none has been assigned.

Broadcasts

nothing

Throws

nothing

Bubbles

no

useFIFOBuffer

public function get useFIFOBuffer ():FIFOBuffer

set sendData

Assigns any data to be sent to the URL request.  This will then be converted appropriately and sent using either a “GET” or “POST” operation to the server based on the setting of the method value.  See the <URLRequest.data> property for more information on how this data is handled and converted.

Parameter

Object: An object containing data to send to the server.  This is typically composed of name/value pairs where the name is the property name within the object and the value is its value.  Data to be sent will be automatically converted to URL-friendly formats (e.g.  URL encoding) before being sent.  Must not be NULL.

Broadcasts

nothing

Throws

nothing

Bubbles

no

sendData

public function set sendData (dataObject: Object)

get sendData

Returns any data assigned to the request object for sending to the server.  See the <URLRequest.data> property for more information on how this data is handled and converted.

Returns

Object: An object containing name/value pairs to be sent to the server during a send/load operation.

Broadcasts

nothing

Throws

nothing

Bubbles

no

sendData

public function get sendData ():Object

startFastBuffer

private function startFastBuffer ():void

Begins the fast buffer thread used for more accurate updates of the transfer buffer.  The typical method of updating the transfer buffer is to do so on a standard event broadcast from the stream.  However, these may be infrequent and only include data in chunks.  The fast buffer, in comparison runs on a timer thread and reads data immediately even if an event hasn’t yet been broadcast from the stream.  To enable fast buffering, simply set this instance’s fastBuffer property to true.  Be aware that this has extra processing and memory overhead since buffer checking shuffles loaded data around in memory on each thread tick.

Parameters

none

Returns

nothing

Broadcasts

nothing

Throws

nothing

Bubbles

no

stopFastBuffer

private function stopFastBuffer ():void

Stops the fast buffer execution thread, if running, and cleans up the Thread instance for garbage collection. this method may be called blind since the Thread instance is not assumed to be active.

Parameters

none

Returns

nothing

Broadcasts

nothing

Throws

nothing

Bubbles

no

convertData

private function convertData ():void

Converts data to the content object type based on the internal _type type.  If the loaded data cannot be converted to the target type, an error is reported along with possible remedies.  Note that for certain operations this is the end of the line step wherease for other operations (such as creating Bitmap or MovieClip instances), one more step is required.

Parameters

none

Returns

nothing

Broadcasts

nothing

Throws

nothing

Bubbles

no

See also

onReadLoaderBuffer

setDefaults

private function setDefaults ():void

Sets default properties, instances, and values at class instantiation.  This is the first method to be called by the constructor.

Parameters

none

Returns

nothing

Broadcasts

nothing

Throws

nothing

Bubbles

no

setListeners

private function setListeners ():void

Sets event listeners for the class instance/API chain.  These are used as a secondary access mechanism for the LoadManager instance.  Note that external broadcasts will be rejected as it is assumed that since another instance of the API is running remotely, that instance should manage its own loads.

Parameters

none

Returns

nothing

Broadcasts

nothing

Throws

nothing

Bubbles

no

setSoundListeners

private function setSoundListeners ():void

Sets event listeners for the class instance/API chain.  These listeners are specific to the Sound class and are only set and used when loading a sound.

Parameters

none

Returns

nothing

Broadcasts

nothing

Throws

nothing

Bubbles

no

removeSoundListeners

private function removeSoundListeners ():void

Removes event listeners for the Sound object, typically when the load operation completes.  Because listeners are added before any new Sound load operation, they must also be removed before a subsequent load to prevent multiple event broadcasts.

Parameters

none

Returns

nothing

Broadcasts

nothing

Throws

nothing

Bubbles

no

Manages the creation, destruction, and execution of thread instances.
public const ZLIB_HEADER: String
(String) The three byte signature that identifies a ZLIB compressed file.
public const GIF_Header: String
(String) The three byte signature that identifies a GIF89s image file.
public const JPEG_Header: String
(String) The three byte signature that identifies a JPEG image file.
private var _content: *
(untyped) The object or instance into which loaded data will placed in its final, converted state.
private var _type: String
(String) Defines the target daa type to which to convert the loaded data stored in the _content property.
private var _method: String
(String) The server submission method to use when sendind data to the server.
private var _request: URLRequest
(URLRequest) An instance of the URLRequest class used to build the request object during send/load operations.
private var _stream: URLStream
(URLStream) An instance of the URLStream class used to stream data from the server or local file.
private var _trackingObject: Object
(Object) Object used to track the progress of the current load, including calculations on average load speeds, etc.
private var _buffer: ByteArray
(ByteArray) Used to stora raw binary data as it’s loading and after the load completes.
private var _fastBuffer: Boolean
(Boolean) If TRUE, the fast buffering mechanism is used to allow reading of data at a faster interval.
private var _fastBufferThread: Thread
(Thread) A Thread instance used for monitoring the buffer during fast buffering operations.
Manages the execution of a single thread instance.
private var _FIFOBuffer: FIFOBuffer
(FIFOBuffer) An optional FIFOBuffer instance to be used with this load.
private var _loader: Loader
(Loader) An instance of the Loader class used to dynamically create display objects from a ByteArray once it’s been loaded from the stream.
public function LoadItem ()
Constructor method for the class.
public function start ():void
Attempts to start the load operation.
public function onProgress (eventObj: ProgressEvent):void
Invoked by Flash on any ProgressEvent event for the associated load item.
public function onSoundProgress (eventObj: ProgressEvent):void
Trackes the progress of a Sound instance via ProgressEvent broadcasts.
public function updateFastBuffer ():void
Updates the internal fast buffer which is read on a regular interval, as opposed to the standard progress event broadcast whenever a block of data is read.
public function onLoadComplete (eventObj: Event):void
Invoked via a standard Event event whenever a load operation successfully completes.
public function onHTTPStatus (eventObj: HTTPStatusEvent):void
Invoked via a standard HTTPStatusEvent event whenever a load operation reports an HTTP status (404, 200, etc.)
public function onSecurityError (eventObj: SecurityErrorEvent):void
Invoked via a standard SecurityErrorEvent event whenever a load operation halts due to a security restriction.
public function onIOError (eventObj: IOErrorEvent):void
public function onReadLoaderBuffer(eventObj: Event):void
The final step in data conversion (after invoking convertData) for MovieClip, Bitmap, and Sprite types that require a buffer conversion from a ByteArray to a Loader type.
private function convertData ():void
Converts data to the content object type based on the internal _type type.
public function broadcastCompletionEvent(... args):void
Broadcasts the “LoadItem.COMPLETE” event when a load is ready to report that it has fully completed.
public function set path (pathString: String)
public function get content ():*
public function set type (typeStr: String)
public function set method (methodString: String)
public function set fastBuffer (bufferSet: Boolean)
public function set useFIFOBuffer (buffer: FIFOBuffer)
public function set sendData (dataObject: Object)
private function startFastBuffer ():void
Begins the fast buffer thread used for more accurate updates of the transfer buffer.
private function stopFastBuffer ():void
Stops the fast buffer execution thread, if running, and cleans up the Thread instance for garbage collection.
private function setDefaults ():void
Sets default properties, instances, and values at class instantiation.
private function setListeners ():void
Sets event listeners for the class instance/API chain.
private function setSoundListeners ():void
Sets event listeners for the class instance/API chain.
private function removeSoundListeners ():void
Removes event listeners for the Sound object, typically when the load operation completes.
Provides facilities for dealing with XMLs-structured data.
Manages binary/data loads for the API.