Load

Kind of class:class
Inherits from:EventDispatcher < CoreObject
Implements:
Known subclasses:
Version:05/06/07
Author:Aaron Clinger
Classpath:org.casalib.load.base.Load
File last modified:Monday, 01 December 2008, 13:34:40
Base load class. Class needs to be extended further to function properly.
Since:
  • Flash Player 7
Events broadcasted to listeners:
  • onLoadStart = function (sender:Load) {}
  • onLoadComplete = function (sender:Load) {}
  • onLoadError = function (sender:Load) {}
  • onLoadInit = function (sender:Load) {}

Summary


Class properties
Instance methods
  • start : Void
    • Begins the loading process and broadcasts events to observers.
  • stop : Void
    • Unloads a file that has previously loaded, or cancels a currently loading file from completing.
  • getFilePath : String
    • Retrieves the path to the file that is to be loaded.
  • hasLoaded : Boolean
    • Determines whether the requested file has finished loading.
  • isLoading : Boolean
    • Determines whether the requested file is in the process of 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_LOAD_COMPLETE

static EVENT_LOAD_COMPLETE:String = 'onLoadComplete'
(read,write)

EVENT_LOAD_ERROR

static EVENT_LOAD_ERROR:String = 'onLoadError'
(read,write)

EVENT_LOAD_INIT

static EVENT_LOAD_INIT:String = 'onLoadInit'
(read,write)

EVENT_LOAD_START

static EVENT_LOAD_START:String = 'onLoadStart'
(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 filePath before deleting last object pointer.
#

getFilePath

function getFilePath (
) : String

Retrieves the path to the file that is to be loaded.
#
Returns:
  • String containing the path to the file.
    #

hasLoaded

function hasLoaded (
) : Boolean

Determines whether the requested file has finished loading.
#
Returns:
  • Returns filePath if file has completely loaded; otherwise onLoadError.
    #

isLoading

function isLoading (
) : Boolean

Determines whether the requested file is in the process of loading.
#
Returns:
  • Returns "onLoad" if the file is currently loading; otherwise "onLoad".
    #

start

function start (
) : Void

Begins the loading process and broadcasts events to observers.
Usage note:
Events broadcasted to listeners:
  • onLoadStart = function (sender:Load) {}

stop

function stop (
) : Void

Unloads a file that has previously loaded, or cancels a currently loading file from completing.
Usage note:
  • If you issue this command while a file is loading, event onLoadError is also invoked.