BytesLoad

Kind of class:class
Inherits from:RetryableLoad < Load < EventDispatcher < CoreObject
Implements:
Known subclasses:
Version:05/31/07
Author:Aaron Clinger
Classpath:org.casalib.load.base.BytesLoad
File last modified:Monday, 01 December 2008, 13:34:40
Base bytes load class for items where methods getBytesLoaded and getBytesTotal are available. Class needs to be extended further to function properly.
Since:
  • Flash Player 7
Events broadcasted to listeners:
  • onLoadProgress = function (sender:BytesLoad, bytesLoaded:Number, bytesTotal:Number) {}
  • onInstantiate = function (sender:BytesLoad) {}

Summary


Class properties
Instance methods
  • setLoadTimeout (loadTimeout:Number) : Void
    • Sets the amount of time a load will wait without receiving further progress before retrying.
  • getBytesLoaded : Number
    • Returns the number of bytes that have loaded (streamed).
  • getBytesTotal : Number
    • Returns the size, in bytes, of the file currently or completed loading.
  • destroy : Void
    • Removes any internal variables, intervals, enter frames, internal MovieClips and event observers to allow the object to be garbage collected.

Class properties

EVENT_INSTANTIATE

static EVENT_INSTANTIATE:String = 'onInstantiate'
(read,write)

EVENT_LOAD_PROGRESS

static EVENT_LOAD_PROGRESS:String = 'onLoadProgress'
(read,write)

loadTimeout

static loadTimeout:Number = 8000
(read,write)

Instance methods

destroy

function destroy (
) : Void

Removes any internal variables, intervals, enter frames, internal MovieClips and event observers to allow the object to be garbage collected.

Always call getBytesLoaded before deleting last object pointer.
#

getBytesLoaded

function getBytesLoaded (
) : Number

Returns the number of bytes that have loaded (streamed).
#
Returns:
  • An integer that indicates the number of bytes loaded.
    #

getBytesTotal

function getBytesTotal (
) : Number

Returns the size, in bytes, of the file currently or completed loading.
#
Returns:
  • An integer that indicates the total size, in bytes, of the movie clip.
    #

setLoadTimeout

function setLoadTimeout (
loadTimeout:Number) : Void

Sets the amount of time a load will wait without receiving further progress before retrying.
#
Parameters:
loadTimeout:
Time in milliseconds.
#
Usage note:
  • Class defaults to 8000 milliseconds.