| Package | ch.capi.net |
| Interface | public interface ILoadableFile extends ILoadManager , INetStateManager , IGlobalEventDispatcher , IEventDispatcher |
| Implementors | LoaderFile, SoundFile, URLLoaderFile, URLStreamFile |
See also
| Property | Defined By | ||
|---|---|---|---|
![]() | bytesLoaded : uint [read-only]
Defines the bytes that have been loaded. | ILoadManager | |
![]() | bytesTotal : uint [read-only]
Defines the total bytes to load. | ILoadManager | |
![]() | closeEvent : Event [read-only]
Defines the event that happend to close the file (Event.CLOSE, Event.COMPLETE, ...). | ILoadManager | |
| fixedRequest : URLRequest [read-only]
Defines the URLRequest that will be loaded by the ILoadableFile. | ILoadableFile | ||
![]() | loaded : Boolean [read-only]
Defines if the ILoadManager operation is complete. | ILoadManager | |
| loadManagerObject : Object [read-only]
Defines the load manager object. | ILoadableFile | ||
![]() | netState : String
Defines the NetState value. | INetStateManager | |
| properties : IProperties [read-only]
Defines the properties stored in the
ILoadableFile. | ILoadableFile | ||
![]() | stateIdle : Boolean [read-only]
Defines if the ILoadManager is idle. | ILoadManager | |
![]() | stateLoading : Boolean [read-only]
Defines if the ILoadManager is loading. | ILoadManager | |
| urlRequest : URLRequest
Defines the URLRequest object that specify the
URL to load. | ILoadableFile | ||
| urlVariables : IMap
Defines the variables key/values to be replaced
in the url before the loading is launched. | ILoadableFile | ||
| useCache : Boolean
Defines if the ILoadableFile can use the cache or not. | ILoadableFile | ||
| virtualBytesTotal : uint
Defines the virtual total bytes. | ILoadableFile | ||
| Method | Defined By | ||
|---|---|---|---|
destroy():void
Destroys this ILoadableFile. | ILoadableFile | ||
getData(dataType:String = null, appDomain:ApplicationDomain = null):*
Retrieves the data of the loadManagerObject if the loading
is complete. | ILoadableFile | ||
getEventDispatcher():IEventDispatcher
Retrieves the IEventDispatcher of all the sub-events
of a ILoadableFile. | ILoadableFile | ||
getType():String
Retrieves the type of the file based on the LoadableFileType constants. | ILoadableFile | ||
invalidateFixedRequest():void
Invalidate the current fixedRequest. | ILoadableFile | ||
isClassSupported(aClass:String, appDomain:ApplicationDomain = null):Boolean
Retrieves if the specified class type is supported by this ILoadableFile or not. | ILoadableFile | ||
isDestroyed():Boolean
Retrieves if this ILoadableFile has been destroyed. | ILoadableFile | ||
![]() | isOnline():Boolean
Retrieves the state depending of the NetState
value defined. | INetStateManager | |
prepareFixedRequest():void
Tells the ILoadableFile to update the fixedRequest value that
will be used to load the file. | ILoadableFile | ||
![]() | start():Boolean
Starts downloading data from the specified URL. | ILoadManager | |
![]() | stop():void
Stops the load operation in progress. | ILoadManager | |
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when the http headers are received. | ILoadableFile | |||
| Dispatched when the content of the loadManagerObject is displayed. | ILoadableFile | |||
| Dispatched if a call to start() results in a fatal error that terminates the download. | ILoadableFile | |||
| Dispatched if a call to start() attempts to load data from a server outside the security sandbox. | ILoadableFile | |||
| Dispatched when the load couldn't start. | ILoadableFile | |||
| fixedRequest | property |
fixedRequest:URLRequest [read-only]
Defines the URLRequest that will be loaded by the ILoadableFile. This
URLRequest has no more variables. If for some reason you need to modify the fixed
request before starting the loading you should call the prepareFixedRequest() before,
otherwise all your changes will be lost.
public function get fixedRequest():URLRequestSee also
| loadManagerObject | property |
loadManagerObject:Object [read-only]
Defines the load manager object. This object represents the object that
manages the loading, i.e. a Loader, URLLoader,
Sound, ...
public function get loadManagerObject():Object| properties | property |
properties:IProperties [read-only]
Defines the properties stored in the
ILoadableFile.
public function get properties():IProperties| urlRequest | property |
urlRequest:URLRequest [read-write]
Defines the URLRequest object that specify the
URL to load.
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):voidSee also
| useCache | property |
useCache:Boolean [read-write]
Defines if the ILoadableFile can use the cache or not.
public function get useCache():Boolean public function set useCache(value:Boolean):void| virtualBytesTotal | property |
virtualBytesTotal:uint [read-write] Defines the virtual total bytes. This value represents an approximation of the total bytes. This value should be greather than the real amount of bytes of the loadable file.
public function get virtualBytesTotal():uint public function set virtualBytesTotal(value:uint):void| 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.
After calling this method, no more operation is available on the ILoadableFile instance.
| getData | () | method |
public function getData(dataType:String = null, appDomain:ApplicationDomain = null):*
Retrieves the data of the loadManagerObject if the loading
is complete. If the asClass parameter is specified, then the ILoadableFile
will try to create an instance of it and parse the content in it.
Parameters
dataType:String (default = null) — The type that should be returned by the method (see DataType).
| |
appDomain:ApplicationDomain (default = null) — The ApplicationDomain to retrieve the class. If null is specified, then
the current domain will be used.
|
* — The data of the loadManagerObject.
|
ArgumentError If — the class type is not supported.
| |
ch.capi.errors:DataError If — the data are not loaded.
|
See also
| getEventDispatcher | () | method |
public function getEventDispatcher():IEventDispatcher
Retrieves the IEventDispatcher of all the sub-events
of a ILoadableFile. For example, the source event dispatcher
of a Loader object will be his contentLoaderInfo.
IEventDispatcher — The IEventDispatcher.
|
| getType | () | method |
public function getType():String
Retrieves the type of the file based on the LoadableFileType constants.
String — The ILoadableFile type.
|
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
| isClassSupported | () | method |
public function isClassSupported(aClass:String, appDomain:ApplicationDomain = null):Boolean
Retrieves if the specified class type is supported by this ILoadableFile or not.
Parameters
aClass:String — The class type to check.
| |
appDomain:ApplicationDomain (default = null) — The ApplicationDomain to retrieve the class. If null is specified, then
the current domain will be used.
|
Boolean — true if the type is supported.
|
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.
|
| prepareFixedRequest | () | method |
public function prepareFixedRequest():void
Tells the ILoadableFile to update the fixedRequest value that
will be used to load the file.
See also
| 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.
| 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.