| Package | ch.capi.net.files |
| Class | public class AbstractLoadableFile |
| Inheritance | AbstractLoadableFile GlobalEventDispatcher flash.events.EventDispatcher |
| Implements | INetStateManager |
| Subclasses | LoaderFile, SoundFile, URLLoaderFile, URLStreamFile |
AbstractLoadableFile. This is a basic
implementation to store the generic data of a ILoadableFile.
See also
| Property | Defined By | ||
|---|---|---|---|
| bytesLoaded : uint [read-only]
Defines the bytes that have been loaded. | AbstractLoadableFile | ||
| bytesTotal : uint [read-only]
Defines the total bytes to load. | AbstractLoadableFile | ||
| bytesTotalRetrieved : Boolean [read-only]
Defines if the bytesTotal have been retrieved. | AbstractLoadableFile | ||
| closeEvent : Event [read-only]
Defines the event that happend to close the file (Event.CLOSE, Event.COMPLETE, ...). | AbstractLoadableFile | ||
![]() | dispatchGlobalEvents : Boolean
Defines if the global events must be dispatched or not. | GlobalEventDispatcher | |
| fixedRequest : URLRequest [read-only]
Defines the URLRequest that has been loaded by the
ILoadableFile. | AbstractLoadableFile | ||
| loaded : Boolean [read-only]
Defines if the ILoadManager operation is complete. | AbstractLoadableFile | ||
| loadManagerObject : Object [read-only]
Defines the load manager object. | AbstractLoadableFile | ||
| netState : String
Defines the NetState value. | AbstractLoadableFile | ||
| properties : IProperties [read-only]
Defines the properties stored in the
ILoadableFile. | AbstractLoadableFile | ||
| stateIdle : Boolean [read-only]
Defines if the AbstractLoadableFile is idle. | AbstractLoadableFile | ||
| stateLoading : Boolean [read-only]
Defines if the AbstractLoadableFile is loading. | AbstractLoadableFile | ||
| urlRequest : URLRequest
Defines the URLRequest object that specify the
URL to load. | AbstractLoadableFile | ||
| urlVariables : IMap
Defines the variables key/values to be replaced
in the url before the loading is launched. | AbstractLoadableFile | ||
| useCache : Boolean
Defines if the ILoadManager can use the cache or not. | AbstractLoadableFile | ||
| virtualBytesTotal : uint
Defines the virtual total bytes. | AbstractLoadableFile | ||
| Method | Defined By | ||
|---|---|---|---|
AbstractLoadableFile(loadManagerObject:Object)
Creates a new AbstractLoadableFile object. | AbstractLoadableFile | ||
destroy():void
Destroys this ILoadableFile. | AbstractLoadableFile | ||
![]() | dispatchEvent(evt:Event):Boolean
Dispatches the specified Event through the listeners. | GlobalEventDispatcher | |
invalidateFixedRequest():void
Invalidate the current fixedRequest. | AbstractLoadableFile | ||
isDestroyed():Boolean
Retrieves if this ILoadableFile has been destroyed. | AbstractLoadableFile | ||
isOnline():Boolean
Retrieves if the current AbstractLoadableFile is online or not. | AbstractLoadableFile | ||
prepareFixedRequest():void
Tells the ILoadableFile to update the fixedRequest value that
will be used to load the file. | AbstractLoadableFile | ||
start():Boolean
Set the state as loading. | AbstractLoadableFile | ||
stop():void
Set the state as idle. | AbstractLoadableFile | ||
toString():String
Get the URL of the AbstractLoadableFile. | AbstractLoadableFile | ||
| Method | Defined By | ||
|---|---|---|---|
checkData():void
Checks if data has been loaded and is available to be retrieved. | AbstractLoadableFile | ||
checkDestroyed():void
Checks if the current ILoadableFile has been destroyed and if so, throws an IllegalOperationError. | AbstractLoadableFile | ||
getUpdatedUrlRequest():URLRequest
Creates a clone of the current URLRequest and put the variables values in its data. | AbstractLoadableFile | ||
getURLRequest():URLRequest
Retrieves the URLRequest that is created depending of
the useCache property value. | AbstractLoadableFile | ||
isInstanceOf(source:String, superClasses:Array, appDomain:ApplicationDomain = null):Boolean
Checks if the specified source class is a child of one of the specified super classes. | AbstractLoadableFile | ||
isInstanceOfClass(source:String, superClass:String, appDomain:ApplicationDomain = null):Boolean
Checks if the specified source class is a child of the specified super class. | AbstractLoadableFile | ||
onComplete(evt:Event):void
Event.COMPLETE listener. | AbstractLoadableFile | ||
onHttpStatus(evt:HTTPStatusEvent):void
HTTPStatusEvent.HTTP_STATUS listener. | AbstractLoadableFile | ||
onInit(evt:Event):void
Event.INIT listener. | AbstractLoadableFile | ||
onIOError(evt:IOErrorEvent):void
IOErrorEvent listener. | AbstractLoadableFile | ||
onOpen(evt:Event):void
Event.OPEN listener. | AbstractLoadableFile | ||
onProgress(evt:ProgressEvent):void
ProgressEvent.PROGRESS listener. | AbstractLoadableFile | ||
onSecurityError(evt:SecurityErrorEvent):void
SecurityErrorEvent listener. | AbstractLoadableFile | ||
processLoading(request:URLRequest):void
Tell the ILoadableFile to start the loading process. | AbstractLoadableFile | ||
registerTo(dispatcher:IEventDispatcher):void
Register the events of the AbstractLoadableFile. | AbstractLoadableFile | ||
unregisterFrom(dispatcher:IEventDispatcher):void
Unregister the events of the AbstractLoadableFile. | AbstractLoadableFile | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when the download operation stops. | AbstractLoadableFile | |||
| Dispatched after all the received data is received. | AbstractLoadableFile | |||
![]() | Dispatched after an event is dispatched. | GlobalEventDispatcher | ||
![]() | Dispatched before an event is dispatched. | GlobalEventDispatcher | ||
| Dispatched when the http headers are received. | AbstractLoadableFile | |||
| Dispatched when the content of the loadManagerObject is displayed. | AbstractLoadableFile | |||
| Dispatched if a call to start() results in a fatal error that terminates the download. | AbstractLoadableFile | |||
| Dispatched when the download operation commences following a call to the ILoadManager.load() method. | AbstractLoadableFile | |||
| Dispatched when data is received as the download operation progresses. | AbstractLoadableFile | |||
| Dispatched if a call to start() attempts to load data from a server outside the security sandbox. | AbstractLoadableFile | |||
| Dispatched when the load couldn't start. | AbstractLoadableFile | |||
| Constant | Defined By | ||
|---|---|---|---|
| NO_CACHE_VARIABLE_NAME : String = noCache [static]
Name of the 'no cache' variable. | AbstractLoadableFile | ||
| bytesLoaded | property |
bytesLoaded:uint [read-only] Defines the bytes that have been loaded.
public function get bytesLoaded():uint| bytesTotal | property |
bytesTotal:uint [read-only] Defines the total bytes to load.
public function get bytesTotal():uint| bytesTotalRetrieved | property |
bytesTotalRetrieved:Boolean [read-only]
Defines if the bytesTotal have been retrieved.
public function get bytesTotalRetrieved():Boolean| closeEvent | property |
closeEvent:Event [read-only] Defines the event that happend to close the file (Event.CLOSE, Event.COMPLETE, ...).
public function get closeEvent():Event| fixedRequest | property |
fixedRequest:URLRequest [read-only]
Defines the URLRequest that has been loaded by the
ILoadableFile.
public function get fixedRequest():URLRequest| loaded | property |
loaded:Boolean [read-only]
Defines if the ILoadManager operation is complete. This
value is true only if the data has been successfully loaded.
public function get loaded():Boolean| loadManagerObject | property |
loadManagerObject:Object [read-only] Defines the load manager object.
public function get loadManagerObject():Object| netState | property |
netState:String [read-write]
Defines the NetState value. The value available can
be retrieved from the NetState class.
public function get netState():String public function set netState(value:String):voidSee also
| properties | property |
properties:IProperties [read-only]
Defines the properties stored in the
ILoadableFile.
public function get properties():IProperties| stateIdle | property |
stateIdle:Boolean [read-only]
Defines if the AbstractLoadableFile is idle.
public function get stateIdle():Boolean| stateLoading | property |
stateLoading:Boolean [read-only]
Defines if the AbstractLoadableFile is loading.
public function get stateLoading():Boolean| urlRequest | property |
urlRequest:URLRequest [read-write]
Defines the URLRequest object that specify the
URL to load. If the AbstractLoadableFile is destroyed,
it will keep a URLRequest object with the URL.
public function get urlRequest():URLRequest public function set urlRequest(value:URLRequest):void| urlVariables | property |
urlVariables:IMap [read-write] Defines the variables key/values to be replaced in the url before the loading is launched.
public function get urlVariables():IMap public function set urlVariables(value:IMap):void| useCache | property |
useCache:Boolean [read-write]
Defines if the ILoadManager can use the cache or not.
public function get useCache():Boolean public function set useCache(value:Boolean):voidSee also
| virtualBytesTotal | property |
virtualBytesTotal:uint [read-write] Defines the virtual total bytes. This value represents an approximation of the total bytes. This value should be greater than the real amount of bytes of the loadable file.
public function get virtualBytesTotal():uint public function set virtualBytesTotal(value:uint):void| AbstractLoadableFile | () | Constructor |
public function AbstractLoadableFile(loadManagerObject:Object)
Creates a new AbstractLoadableFile object. This method throws an error if
it is directly called or if a sub-class doesn't implement the ILoadableFile interface.
loadManagerObject:Object — The loadManagerObject.
|
flash.errors:IllegalOperationError If — the sub-class doesn't implement ILoadableFile.
|
| checkData | () | method |
protected function checkData():void
Checks if data has been loaded and is available to be retrieved. If not, then an Error
will be thrown. This method is useful to get direct information about why the data couldn't be retrieved.
ch.capi.errors:DataError If — the data are not loaded.
|
| checkDestroyed | () | method |
protected function checkDestroyed():void
Checks if the current ILoadableFile has been destroyed and if so, throws an IllegalOperationError.
flash.errors:IllegalOperationError If — the AbstractLoadableFile has been destroyed.
|
| destroy | () | method |
public function destroy():void
Destroys this ILoadableFile. This method causes to set the loadManagerObject value to
null and releases all other references to the content loaded contained in the current ILoadableFile.
This method also resets all the variables of the ILoadableFile. It just keeps a URLRequest with the
specified file URL.
After calling this method, no more operation is available on the ILoadableFile instance.
| getUpdatedUrlRequest | () | method |
protected function getUpdatedUrlRequest():URLRequest
Creates a clone of the current URLRequest and put the variables values in its data.
If there is some variables in the data object, they will be also replaced.
URLRequest — The new URLRequest.
|
| getURLRequest | () | method |
protected function getURLRequest():URLRequest
Retrieves the URLRequest that is created depending of
the useCache property value. The creation of the URLRequest
is based on the netState. If the isOnline() method returns
false or the useCache property value is true, then
the current urlRequest is returned. Else a new URLRequest is created,
cloning the data and adding a no cache variable.
URLRequest — The URLRequest.
|
flash.errors:IllegalOperationError If — the AbstractLoadableFile has been destroyed.
|
See also
| invalidateFixedRequest | () | method |
public function invalidateFixedRequest():void
Invalidate the current fixedRequest. It means that the next time
the start() method will be launched, the ILoadableFile
will relaunch the loading of the data, without taking care of the cache.
See also
| isDestroyed | () | method |
public function isDestroyed():Boolean
Retrieves if this ILoadableFile has been destroyed. If this method returns true, then
no more operation is available on the ILoadableFile.
Boolean — true if the file has been destroyed.
|
| isInstanceOf | () | method |
protected function isInstanceOf(source:String, superClasses:Array, appDomain:ApplicationDomain = null):BooleanChecks if the specified source class is a child of one of the specified super classes.
Parameters
source:String — The source class.
| |
superClasses:Array — An Array of String describing a list of classes.
| |
appDomain:ApplicationDomain (default = null) — The ApplicationDomain to retrieve the classes.
|
Boolean — true if the source class extends one of the super classes.
|
| isInstanceOfClass | () | method |
protected function isInstanceOfClass(source:String, superClass:String, appDomain:ApplicationDomain = null):BooleanChecks if the specified source class is a child of the specified super class.
Parameters
source:String — The source class (child).
| |
superClass:String — The super class.
| |
appDomain:ApplicationDomain (default = null) — The ApplicationDomain to retrieve the classe.
|
Boolean — true if the source class extends the super class.
|
See also
| isOnline | () | method |
public function isOnline():Boolean
Retrieves if the current AbstractLoadableFile is online or not. If the current netState
value is NetState.DYNAMIC, then the online state is retrieved from the specified url. If the url
is relative (no protocol specified), then the online state is retrieved from the current security sandbox.
Boolean — true if the AbstractLoadableFile is online.
|
flash.errors:IllegalOperationError If — the AbstractLoadableFile has been destroyed.
|
See also
| onComplete | () | method |
protected function onComplete(evt:Event):void
Event.COMPLETE listener.
Parameters
evt:Event — The event object.
|
| onHttpStatus | () | method |
protected function onHttpStatus(evt:HTTPStatusEvent):void
HTTPStatusEvent.HTTP_STATUS listener.
Parameters
evt:HTTPStatusEvent — The event object.
|
| onInit | () | method |
protected function onInit(evt:Event):void
Event.INIT listener. This method retrieves the root DisplayObject associated
to the LoaderInfo and then initializes the content.
Parameters
evt:Event — The event object.
|
ArgumentError If — the Event target is not a LoaderInfo instance.
|
| onIOError | () | method |
protected function onIOError(evt:IOErrorEvent):void
IOErrorEvent listener.
Parameters
evt:IOErrorEvent — The event object.
|
| onOpen | () | method |
protected function onOpen(evt:Event):void
Event.OPEN listener.
Parameters
evt:Event — The event object.
|
| onProgress | () | method |
protected function onProgress(evt:ProgressEvent):void
ProgressEvent.PROGRESS listener.
Parameters
evt:ProgressEvent — The event object.
|
| onSecurityError | () | method |
protected function onSecurityError(evt:SecurityErrorEvent):void
SecurityErrorEvent listener.
Parameters
evt:SecurityErrorEvent — The event object.
|
| prepareFixedRequest | () | method |
public function prepareFixedRequest():void
Tells the ILoadableFile to update the fixedRequest value that
will be used to load the file. By default, this method is automatically called when the
start() method is executed and the fixedRequest hasn't been updated.
flash.errors:IllegalOperationError If — the AbstractLoadableFile has been destroyed.
|
| processLoading | () | method |
protected function processLoading(request:URLRequest):void
Tell the ILoadableFile to start the loading process. This method
is supposed to be overriden by the sub-classes. It always throws an
IllegalOperationError.
Parameters
request:URLRequest |
flash.errors:IllegalOperationError Always — if not overriden.
|
| registerTo | () | method |
protected function registerTo(dispatcher:IEventDispatcher):void
Register the events of the AbstractLoadableFile.
Parameters
dispatcher:IEventDispatcher — The IEventDispatcher of the events.
|
See also
| start | () | method |
public final function start():Boolean
Set the state as loading. This method also update the fixedRequest if it hasn't been done before. In any cases,
the fixedRequest is invalidated right after the loading is started (just to ensure that the fixedRequest
will be update the next time the start() method is called).
Boolean — true if the loading has been started, false otherwise.
|
flash.errors:IllegalOperationError If — the AbstractLoadableFile has been destroyed.
| |
flash.errors:IllegalOperationError If — the AbstractLoadableFile is already loading.
|
| stop | () | method |
public final function stop():voidSet the state as idle.
flash.errors:IllegalOperationError If — the AbstractLoadableFile has been destroyed.
| |
flash.errors:IllegalOperationError If — the ILoadManager is not loading.
|
| toString | () | method |
override public function toString():String
Get the URL of the AbstractLoadableFile.
String — The url or null if the urlRequest is not defined.
|
| unregisterFrom | () | method |
protected function unregisterFrom(dispatcher:IEventDispatcher):void
Unregister the events of the AbstractLoadableFile.
Parameters
dispatcher:IEventDispatcher — The IEventDispatcher of the events.
|
See also
| close | Event |
flash.events.Eventflash.events.Event.CLOSE
Dispatched when the download operation stops. This is following a call to the ILoadManager.stop()
method.
| complete | Event |
flash.events.Eventflash.events.Event.COMPLETEDispatched after all the received data is received.
| httpStatus | Event |
flash.events.HTTPStatusEventflash.events.HTTPStatusEvent.HTTP_STATUSDispatched when the http headers are received. This event isn't sent by the all the load manager objects.
| init | Event |
flash.events.Eventflash.events.Event.INIT
Dispatched when the content of the loadManagerObject is displayed. This event is only dispatched if the
type of ILoadableFile is LoadableFileType.SWF or when the data of a binary URLLoaderFile is
retrieved as DataType.LOADER.
| ioError | Event |
flash.events.IOErrorEventflash.events.IOErrorEvent.IO_ERROR
Dispatched if a call to start() results in a fatal error that terminates the download.
| open | Event |
flash.events.Eventflash.events.Event.OPEN
Dispatched when the download operation commences following a call to the ILoadManager.load()
method.
| progress | Event |
flash.events.ProgressEventflash.events.ProgressEvent.PROGRESSDispatched when data is received as the download operation progresses.
| securityError | Event |
flash.events.SecurityErrorEventflash.events.SecurityErrorEvent.SECURITY_ERROR
Dispatched if a call to start() attempts to load data from a server outside the security sandbox.
| startFailed | Event |
ch.capi.events.LoadStartErrorEventch.capi.events.LoadStartErrorEvent.START_FAILED
Dispatched when the load couldn't start. That means that an error has occured during the start() method
and an Error has been thrown.
| NO_CACHE_VARIABLE_NAME | Constant |
public static const NO_CACHE_VARIABLE_NAME:String = noCacheName of the 'no cache' variable.