Packagech.capi.net
Interfacepublic interface ILoadableFile extends ILoadManager, flash.events.IEventDispatcher, INetStateManager
ImplementorsExtensionFileSelector

Represents a loadable file.

See also

AbstractLoadableFile
LoadableFileFactory
LoadableFileType
ILoadableFileSelector


Public Properties
 PropertyDefined by
 InheritedbytesLoaded : uint
Defines the bytes that have been loaded.
ILoadManager
 InheritedbytesTotal : uint
Defines the total bytes to load.
ILoadManager
 InheritedcloseEvent : Event
Defines the event that happend to close the file (Event.CLOSE, Event.COMPLETE, ...).
ILoadManager
  loadManagerObject : Object
[read-only] Defines the load manager object.
ILoadableFile
 InheritednetState : String
Defines the NetState value.
INetStateManager
  properties : IMap
[read-only] Defines the properties stored into the ILoadableFile.
ILoadableFile
 InheritedstateIdle : Boolean
Defines if the ILoadManager is idle.
ILoadManager
 InheritedstateLoading : Boolean
Defines if the ILoadManager is loading.
ILoadManager
  urlRequest : URLRequest
Defines the URLRequest object that specify the URL to load.
ILoadableFile
 InheriteduseCache : Boolean
Defines if the ILoadManager can use the cache or not.
ILoadManager
  virtualBytesTotal : uint
Defines the virtual total bytes.
ILoadableFile
Public Methods
 MethodDefined by
  
getData(asClass: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
  
isClassSupported(aClass:String, appDomain:ApplicationDomain = null):Boolean
Retrieves if the specified class type is supported by this ILoadableFile or not.
ILoadableFile
 Inherited
isOnline():Boolean
Retrieves the state depending of the NetState value defined.
INetStateManager
 Inherited
start():void
Starts downloading data from the specified URL.
ILoadManager
 Inherited
stop():void
Stops the load operation in progress.
ILoadManager
Events
 EventSummaryDefined by
 Inherited Dispatched when the download operation stops.ILoadManager
 Inherited Dispatched after all the received data is received.ILoadManager
   Dispatched if a call to start() results in a fatal error that terminates the download.ILoadableFile
 Inherited Dispatched when the download operation commences following a call to the ILoadManager.load() method.ILoadManager
 Inherited Dispatched when data is received as the download operation progresses.ILoadManager
   Dispatched if a call to start() attempts to load data from a server outside the security sandbox.ILoadableFile
Property detail
loadManagerObjectproperty
loadManagerObject:Object  [read-only]

Defines the load manager object. This object can be a Loader or a URLLoader.

Implementation
    public function get loadManagerObject():Object
propertiesproperty 
properties:IMap  [read-only]

Defines the properties stored into the ILoadableFile.

Implementation
    public function get properties():IMap
urlRequestproperty 
urlRequest:URLRequest  [read-write]

Defines the URLRequest object that specify the URL to load.

Implementation
    public function get urlRequest():URLRequest
    public function set urlRequest(value:URLRequest):void
virtualBytesTotalproperty 
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.

Implementation
    public function get virtualBytesTotal():uint
    public function set virtualBytesTotal(value:uint):void
Method detail
getData()method
public function getData(asClass:String = null, appDomain:ApplicationDomain = null):*

Retrieves the data of the loadManagerObject if the loading is complete. If the asType parameter is specified, then the ILoadableFile will try to create an instance of it and parse the content into it.

Parameters
asClass:String (default = null) — asClass The class instance that should be returned by the method.
 
appDomain:ApplicationDomain (default = null) — The ApplicationDomain to retrieve the class. If null is specified, then the current domain will be used.

Returns
* — The data of the loadManagerObject.

Throws
— If the class type is not supported.

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.

Returns
IEventDispatcher — The IEventDispatcher.
getType()method 
public function getType():String

Retrieves the type of the file based on the LoadableFileType constants.

Returns
String — The ILoadableFile type.

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.

Returns
Booleantrue if the type is supported.
Event detail
ioErrorevent 
Event object type: flash.events.IOErrorEvent

Dispatched if a call to start() results in a fatal error that terminates the download.

securityErrorevent  
Event object type: flash.events.SecurityErrorEvent

Dispatched if a call to start() attempts to load data from a server outside the security sandbox.