Packagecom.bourre.load
Classpublic class AbstractLoader
ImplementsASyncCommand, Loader
SubclassesApplicationLoader, FileLoader, GraphicLoader, QueueLoader, RemotingCall, SoundLoader, StreamLoader, VideoDisplay

Player version: Flash Player 9.0
Language version: ActionScript 3.0

The AbstractLoader class gives abstract implementation of a loader object.



Protected Properties
 PropertyDefined by
  _sPrefixURL : String
AbstractLoader
  _sURL : String
AbstractLoader
Public Methods
 MethodDefined by
  
AbstractLoader(strategy:LoadStrategy = null)
Creates new AbstractLoader instance.
AbstractLoader
  
addASyncCommandListener(listener:ASyncCommandListener, ... rest):Boolean
Adds the passed-in command listener object as listener for this command events.
AbstractLoader
  
addEventListener(type:String, listener:Object, ... rest):Boolean
Adds an event listener for the specified event type.
AbstractLoader
  
addListener(listener:Object):Boolean
Adds the passed-in listener as listener for all events dispatched by this event broadcaster.
AbstractLoader
  
execute(e:Event = null):void
Execute the request according to the current command data.
AbstractLoader
  
Fires the onCommandEnd event to the listeners of this command.
AbstractLoader
  
fireOnLoadErrorEvent(message:String = ""):void
Dispatches event when an error occur.
AbstractLoader
  
Dispatches event when the loading is finished.
AbstractLoader
  
Dispatches event during loading progression.
AbstractLoader
  
Dispatches event when the loading starts.
AbstractLoader
  
AbstractLoader
  
Returns the number of bytes loaded.
AbstractLoader
  
Returns the total number of bytes to load.
AbstractLoader
  
getContent():Object
Returns loaded content.
AbstractLoader
  
getName():String
Returns the loader identifier.
AbstractLoader
  
getPerCent():Number
Returns a percentage of bytes loaded and total bytes to load.
AbstractLoader
  
Returns loading strategy used by the loader.
AbstractLoader
  
getTimeOut():Number
Returns the loading timeout limit
AbstractLoader
  
getURL():URLRequest
Returns the URL used by this loader.
AbstractLoader
  
isAntiCache():Boolean
Returns true if 'anticache' system is on.
AbstractLoader
  
isLoaded():Boolean
Returns true if all bytes are loaded.
AbstractLoader
  
isRunning():Boolean
Returns true if this object is running.
AbstractLoader
  
load(url:URLRequest = null, context:LoaderContext = null):void
Loads content.
AbstractLoader
  
prefixURL(sURL:String):void
Adds prefix to URL passed to the loader instance.
AbstractLoader
  
release():void
Releases instance and all registered listeners.
AbstractLoader
  
Removes the passed-in command listener object as listener for this command events.
AbstractLoader
  
removeEventListener(type:String, listener:Object):Boolean
Removes the passed-in listener for listening the specified event.
AbstractLoader
  
removeListener(listener:Object):Boolean
Removes the passed-in listener object from this event broadcaster.
AbstractLoader
  
run():void
Starts the asynchronous process of this runnable object.
AbstractLoader
  
setAntiCache(b:Boolean):void
Sets the 'anticache' system to true to add timestamp value to the loaded URL.
AbstractLoader
  
setContent(content:Object):void
Uses to replace this loader content.
AbstractLoader
  
setName(sName:String):void
Sets the loader identifier.
AbstractLoader
  
setTimeOut(n:Number):void
Sets a loading timeout limit.
AbstractLoader
  
setURL(url:URLRequest):void
Defined from which the URL will be loaded.
AbstractLoader
Protected Methods
 MethodDefined by
  
fireEvent(e:Event):void
Dispatched passed-in event to all registered listeners.
AbstractLoader
  
fireEventType(type:String, errorMessage:String = ""):void
Dispatches event using passed-in type and optional error message.
AbstractLoader
  
getLoaderEvent(type:String, errorMessage:String = ""):LoaderEvent
Returns a loader event for current loader instance.
AbstractLoader
  
onInitialize():void
AbstractLoader
  
Defines the type of listeners this event broadcaster support.
AbstractLoader
Events
 EventSummaryDefined by
   Dispatched when an error occurs during loading.AbstractLoader
   Dispatched when loading is finished.AbstractLoader
   Dispatched during loading progression.AbstractLoader
   Dispatched when loader starts loading.AbstractLoader
   Dispatched when a timeout occurs during loading.AbstractLoader
Property detail
_sPrefixURLproperty
protected var _sPrefixURL:String

Player version: Flash Player 9.0
Language version: ActionScript 3.0

_sURLproperty 
protected var _sURL:String

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Constructor detail
AbstractLoader()constructor
public function AbstractLoader(strategy:LoadStrategy = null)

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Creates new AbstractLoader instance.

Parameters
strategy:LoadStrategy (default = null) — Loading strategy to use in this loader.
Method detail
addASyncCommandListener()method
public final function addASyncCommandListener(listener:ASyncCommandListener, ... rest):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Adds the passed-in command listener object as listener for this command events.

The addASyncCommandListener function support the custom arguments provided by the EventBroadcaster.addEventListener() method.

Parameters
listener:ASyncCommandListener — the listener object which want to receive notification from this command
 
... rest — optional arguments corresponding to the EventBroadcaster.addEventListener() behavior.

Returns
Booleantrue if the listener have been added as result of the call
addEventListener()method 
public function addEventListener(type:String, listener:Object, ... rest):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Adds an event listener for the specified event type. There is two behaviors for the addEventListener function :

  1. The passed-in listener is an object : The object is added as listener only for the specified event, the object must have a function with the same name than type or at least a handleEvent function.
  2. The passed-in listener is a function : A Delegate object is created and then added as listener for the event type. There is no restriction on the name of the function. If the rest is not empty, all elements in it is used as additional arguments into the delegate object.

Parameters
type:String — name of the event for which register the listener
 
listener:Object — object or function which will receive this event
 
... rest — additional arguments for the function listener

Returns
Booleantrue if the function have been succesfully added as listener fot the passed-in event
addListener()method 
public function addListener(listener:Object):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Adds the passed-in listener as listener for all events dispatched by this event broadcaster. The function returns true if the listener have been added at the end of the call. If the listener is already registered in this event broadcaster the function returns false.

Note : The addListener function doesn't accept functions as listener, functions could only register for a single event.

Parameters
listener:Object — the listener object to add as global listener

Returns
Booleantrue if the listener have been added during this call
execute()method 
public function execute(e:Event = null):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Execute the request according to the current command data.

Parameters
e:Event (default = null)

See also

load()
fireCommandEndEvent()method 
public final function fireCommandEndEvent():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Fires the onCommandEnd event to the listeners of this command.

fireEvent()method 
protected function fireEvent(e:Event):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Dispatched passed-in event to all registered listeners.

Parameters
e:Event — Event to dispatch
fireEventType()method 
protected function fireEventType(type:String, errorMessage:String = ""):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Dispatches event using passed-in type and optional error message.

Parameters
type:String — Event type so dispatch
 
errorMessage:String (default = "") — (optional) Error message to carry

See also

fireOnLoadErrorEvent()method 
public function fireOnLoadErrorEvent(message:String = ""):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Dispatches event when an error occur.

Parameters
message:String (default = "")
fireOnLoadInitEvent()method 
public final function fireOnLoadInitEvent():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Dispatches event when the loading is finished.

fireOnLoadProgressEvent()method 
public function fireOnLoadProgressEvent():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Dispatches event during loading progression.

fireOnLoadStartEvent()method 
public function fireOnLoadStartEvent():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Dispatches event when the loading starts.

fireOnLoadTimeOut()method 
public function fireOnLoadTimeOut():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

getBytesLoaded()method 
public function getBytesLoaded():uint

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the number of bytes loaded.

Returns
uint — The number of bytes loaded
getBytesTotal()method 
public function getBytesTotal():uint

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the total number of bytes to load.

Returns
uint — The total number of bytes to load
getContent()method 
public function getContent():Object

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns loaded content.

Returns
Object — The loaded content
getLoaderEvent()method 
protected function getLoaderEvent(type:String, errorMessage:String = ""):LoaderEvent

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns a loader event for current loader instance.

Parameters
type:String — Event type to dispatch
 
errorMessage:String (default = "")

Returns
LoaderEvent — A loader event for current loader instance.
getName()method 
public function getName():String

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the loader identifier.

Returns
String — The loader identifier.
getPerCent()method 
public final function getPerCent():Number

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns a percentage of bytes loaded and total bytes to load.

Returns
Number
getStrategy()method 
public function getStrategy():LoadStrategy

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns loading strategy used by the loader.

Returns
LoadStrategy
getTimeOut()method 
public final function getTimeOut():Number

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the loading timeout limit

Returns
Number

See also

getURL()method 
public function getURL():URLRequest

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the URL used by this loader.

If 'anticache' or 'prefix' are used, returns the full qualified url.

Returns
URLRequest — The URL used by this loader.
isAntiCache()method 
public function isAntiCache():Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns true if 'anticache' system is on.

Returns
Booleantrue if 'anticache' system is on.
isLoaded()method 
public final function isLoaded():Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns true if all bytes are loaded.

Returns
Booleantrue if all bytes are loaded.
isRunning()method 
public function isRunning():Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns true if this object is running.

Returns
Booleantrue if this object is running.
load()method 
public function load(url:URLRequest = null, context:LoaderContext = null):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Loads content.

Parameters
url:URLRequest (default = null) — The absolute or relative URL of the content to load.
 
context:LoaderContext (default = null) — (optional) A LoaderContext object, which has properties that define the following:
  • Whether or not to check for the existence of a policy file upon loading the object
  • The ApplicationDomain for the loaded object
  • The SecurityDomain for the loaded object
  • /ul>

    For complete details, see the description of the properties in the LoaderContext class.

onInitialize()method 
protected function onInitialize():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

prefixURL()method 
public function prefixURL(sURL:String):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Adds prefix to URL passed to the loader instance.

Parameters
sURL:String — String ( prefix ) to insert before url value.
release()method 
public function release():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Releases instance and all registered listeners.

removeASyncCommandListener()method 
public final function removeASyncCommandListener(listener:ASyncCommandListener):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Removes the passed-in command listener object as listener for this command events.

Parameters
listener:ASyncCommandListener — the listener object which to remove from this command's listeners

Returns
Booleantrue if the listener have been removed as result of the call
removeEventListener()method 
public function removeEventListener(type:String, listener:Object):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Removes the passed-in listener for listening the specified event. The listener could be either an object or a function.

Parameters
type:String — name of the event for which unregister the listener
 
listener:Object — object or function to be unregistered

Returns
Booleantrue if the listener have been successfully removed as listener for the passed-in event
removeListener()method 
public function removeListener(listener:Object):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Removes the passed-in listener object from this event broadcaster. The object is removed as listener for all events the broadcaster may dispatch.

Parameters
listener:Object — the listener object to remove from this event broadcaster object

Returns
Booleantrue if the object have been successfully removed from this event broadcaster
run()method 
public function run():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Starts the asynchronous process of this runnable object.

The contract for concret implementations of the run method is that the Runnable object must be considered as running as result of the call. Except if an exception was throw during the call.

setAntiCache()method 
public function setAntiCache(b:Boolean):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Sets the 'anticache' system to true to add timestamp value to the loaded URL. In this way, it force the re loading of content and not use the possible cache content.

Parameters
b:Booleantrue to set 'anticache' to 'on'
setContent()method 
public function setContent(content:Object):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Uses to replace this loader content.

Parameters
content:Object — New content to set as loader content
setListenerType()method 
protected final function setListenerType(type:Class):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Defines the type of listeners this event broadcaster support. Functions are not concerned by this restriction.

Parameters
type:Class — the type of the listener this event broadcaster support
setName()method 
public function setName(sName:String):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Sets the loader identifier.

Identifier is used to register some loader into locator.

Parameters
sName:String — Loader identifier
setTimeOut()method 
public final function setTimeOut(n:Number):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Sets a loading timeout limit.

Parameters
n:Number
setURL()method 
public function setURL(url:URLRequest):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Defined from which the URL will be loaded.

Parameters
url:URLRequest — URL to load
Event detail
onLoadErrorevent 
Event object type: com.bourre.load.LoaderEvent
LoaderEvent.type property = com.bourre.load.LoaderEvent.onLoadErrorEVENT

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Dispatched when an error occurs during loading.

Defines the value of the type property of the event object for a onLoadError event.

The properties of the event object have the following values:

PropertyValue
type Dispatched event type
MethodValue
getLoader() The loader object
getName() The loader identifier
getErrorMessage() The loader identifier
onLoadInitevent  
Event object type: com.bourre.load.LoaderEvent
LoaderEvent.type property = com.bourre.load.LoaderEvent.onLoadInitEVENT

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Dispatched when loading is finished.

Defines the value of the type property of the event object for a onLoadInit event.

The properties of the event object have the following values:

PropertyValue
type Dispatched event type
MethodValue
getLoader() The loader object
getName() The loader identifier
onLoadProgressevent  
Event object type: com.bourre.load.LoaderEvent
LoaderEvent.type property = com.bourre.load.LoaderEvent.onLoadProgressEVENT

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Dispatched during loading progression.

Defines the value of the type property of the event object for a onLoadProgress event.

The properties of the event object have the following values:

PropertyValue
type Dispatched event type
MethodValue
getLoader() The loader object
getName() The loader identifier
getPercent() The loading progression
onLoadStartevent  
Event object type: com.bourre.load.LoaderEvent
LoaderEvent.type property = com.bourre.load.LoaderEvent.onLoadStartEVENT

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Dispatched when loader starts loading.

Defines the value of the type property of the event object for a onLoadStart event.

The properties of the event object have the following values:

PropertyValue
type Dispatched event type
MethodValue
getLoader() The loader object
getName() The loader identifier
onLoadTimeOutevent  
Event object type: com.bourre.load.LoaderEvent
LoaderEvent.type property = com.bourre.load.LoaderEvent.onLoadTimeOutEVENT

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Dispatched when a timeout occurs during loading.

Defines the value of the type property of the event object for a onLoadTimeOut event.

The properties of the event object have the following values:

PropertyValue
type Dispatched event type
MethodValue
getLoader() The loader object
getName() The loader identifier