| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
The AbstractLoader class gives abstract implementation of a
loader object.
protected var _sPrefixURL:String
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
protected var _sURL:String
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
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.
|
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
| Boolean — true if the listener have been added as result
of the call
|
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 :
- 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.
- 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
| Boolean — true if the function have been succesfully added as
listener fot the passed-in event
|
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
| Boolean — true if the listener have been added during this call
|
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
See also
load()
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.
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
|
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
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 = "") |
public final function fireOnLoadInitEvent():void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Dispatches event when the loading is finished.
public function fireOnLoadProgressEvent():void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Dispatches event during loading progression.
public function fireOnLoadStartEvent():void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Dispatches event when the loading starts.
public function fireOnLoadTimeOut():void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
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
|
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
|
public function getContent():Object
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns loaded content.
Returns
| Object — The loaded content
|
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.
|
public function getName():String
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns the loader identifier.
Returns
| String — The loader identifier.
|
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
public function getStrategy():LoadStrategy
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns loading strategy used by the loader.
Returns
public final function getTimeOut():Number
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns the loading timeout limit
Returns
See also
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.
|
public function isAntiCache():Boolean
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns true if 'anticache' system is on.
Returns
| Boolean — true if 'anticache' system is on.
|
public final function isLoaded():Boolean
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns true if all bytes are loaded.
Returns
| Boolean — true if all bytes are loaded.
|
public function isRunning():Boolean
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns true if this object is running.
Returns
| Boolean — true if this object is running.
|
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.
|
protected function onInitialize():void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
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.
|
public function release():void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Releases instance and all registered listeners.
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
Returns
| Boolean — true if the listener have been removed as result
of the call
|
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
| Boolean — true if the listener have been successfully removed
as listener for the passed-in event
|
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
| Boolean — true if the object have been successfully
removed from this event broadcaster
|
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.
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:Boolean — true to set 'anticache' to 'on'
|
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
|
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
|
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
|
public final function setTimeOut(n:Number):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Sets a loading timeout limit.
Parameters
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 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:
| Property | Value |
type |
Dispatched event type |
| Method | Value |
getLoader()
| The loader object |
getName()
| The loader identifier |
getErrorMessage()
| The loader identifier |
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:
| Property | Value |
type |
Dispatched event type |
| Method | Value |
getLoader()
| The loader object |
getName()
| The loader identifier |
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:
| Property | Value |
type |
Dispatched event type |
| Method | Value |
getLoader()
| The loader object |
getName()
| The loader identifier |
getPercent()
| The loading progression |
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:
| Property | Value |
type |
Dispatched event type |
| Method | Value |
getLoader()
| The loader object |
getName()
| The loader identifier |
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:
| Property | Value |
type |
Dispatched event type |
| Method | Value |
getLoader()
| The loader object |
getName()
| The loader identifier |
LowRA API documentation 2008- 2009
Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1
mer. févr. 25 2009, 9:22 AM GMT+01:00