Packagech.capi.net
Classpublic class AbstractLoadableFile
InheritanceAbstractLoadableFile Inheritance flash.events.EventDispatcher
ImplementsINetStateManager

Represents a AbstractLoadableFile. This is a basic implementation to store the generic data of a ILoadableFile.

See also

ILoadableFile
LoadableFileFactory


Public Properties
 PropertyDefined 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
  loadManagerObject : Object
[read-only] Defines the load manager object.
AbstractLoadableFile
  netState : String
Defines the NetState value.
AbstractLoadableFile
  properties : IMap
[read-only] Defines the properties stored into 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
  useCache : Boolean
Defines if the ILoadManager can use the cache or not.
AbstractLoadableFile
  virtualBytesTotal : uint
Defines the virtual total bytes.
AbstractLoadableFile
Public Methods
 MethodDefined by
  
AbstractLoadableFile(loadManagerObject:Object)
Creates a new AbstractLoadableFile object.
AbstractLoadableFile
  
getURLRequest():URLRequest
Retrieves the URLRequest that is created depending of the useCache property value.
AbstractLoadableFile
  
isOnline():Boolean
Retrieves if the current AbstractLoadableFile is online or not.
AbstractLoadableFile
  
start():void
Stet the state as loading.
AbstractLoadableFile
  
stop():void
Set the state as idle.
AbstractLoadableFile
  
toString():String
Get the URL of the AbstractLoadableFile.
AbstractLoadableFile
Protected Methods
 MethodDefined by
  
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
  
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
  
registerTo(dispatcher:IEventDispatcher):void
Register the events of the AbstractLoadableFile.
AbstractLoadableFile
  
unregisterFrom(dispatcher:IEventDispatcher):void
Unregister the events of the AbstractLoadableFile.
AbstractLoadableFile
Events
 EventSummaryDefined by
   Dispatched when the download operation stops.AbstractLoadableFile
   Dispatched after all the received data is received.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
Public Constants
 ConstantDefined by
  NO_CACHE_VARIABLE_NAME : String = "noCache"
[static] Name of the 'no cache' variable.
AbstractLoadableFile
Property detail
bytesLoadedproperty
bytesLoaded:uint  [read-only]

Defines the bytes that have been loaded.

Implementation
    public function get bytesLoaded():uint
bytesTotalproperty 
bytesTotal:uint  [read-only]

Defines the total bytes to load.

Implementation
    public function get bytesTotal():uint
bytesTotalRetrievedproperty 
bytesTotalRetrieved:Boolean  [read-only]

Defines if the bytesTotal have been retrieved.

Implementation
    public function get bytesTotalRetrieved():Boolean
closeEventproperty 
closeEvent:Event  [read-only]

Defines the event that happend to close the file (Event.CLOSE, Event.COMPLETE, ...).

Implementation
    public function get closeEvent():Event
loadManagerObjectproperty 
loadManagerObject:Object  [read-only]

Defines the load manager object.

Implementation
    public function get loadManagerObject():Object
netStateproperty 
netState:String  [read-write]

Defines the NetState value. The value available can be retrieved from the NetState class.

Implementation
    public function get netState():String
    public function set netState(value:String):void

See also

propertiesproperty 
properties:IMap  [read-only]

Defines the properties stored into the ILoadableFile.

Implementation
    public function get properties():IMap
stateIdleproperty 
stateIdle:Boolean  [read-only]

Defines if the AbstractLoadableFile is idle.

Implementation
    public function get stateIdle():Boolean
stateLoadingproperty 
stateLoading:Boolean  [read-only]

Defines if the AbstractLoadableFile is loading.

Implementation
    public function get stateLoading():Boolean
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
useCacheproperty 
useCache:Boolean  [read-write]

Defines if the ILoadManager can use the cache or not.

Implementation
    public function get useCache():Boolean
    public function set useCache(value:Boolean):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
Constructor detail
AbstractLoadableFile()constructor
public function AbstractLoadableFile(loadManagerObject:Object)

Creates a new AbstractLoadableFile object.

Parameters
loadManagerObject:Object — The loadManagerObject.
Method detail
getURLRequest()method
public 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.

Returns
URLRequest — The URLRequest

See also

isInstanceOf()method 
protected function 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.

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.

Returns
Booleantrue if the source class extends one of the super classes.
isInstanceOfClass()method 
protected function isInstanceOfClass(source:String, superClass:String, appDomain:ApplicationDomain = null):Boolean

Checks 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.

Returns
Booleantrue 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.

Returns
Booleantrue if the AbstractLoadableFile is online.

See also

netState
Security.sandboxType
onComplete()method 
protected function onComplete(evt:Event):void

Event.COMPLETE listener.

Parameters
evt:Event — The event object.
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.
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 function start():void

Stet the state as loading.


Throws
— If the AbstractLoadableFile is already loading.
stop()method 
public function stop():void

Set the state as idle.


Throws
— If the ILoadManager is not loading.
toString()method 
public override function toString():String

Get the URL of the AbstractLoadableFile.

Returns
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

Event detail
closeevent 
Event object type: flash.events.Event

Dispatched when the download operation stops. This is following a call to the ILoadManager.stop() method.

completeevent  
Event object type: flash.events.Event

Dispatched after all the received data is received.

ioErrorevent  
Event object type: flash.events.IOErrorEvent

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

openevent  
Event object type: flash.events.Event

Dispatched when the download operation commences following a call to the ILoadManager.load() method.

progressevent  
Event object type: flash.events.ProgressEvent

Dispatched when data is received as the download operation progresses.

securityErrorevent  
Event object type: flash.events.SecurityErrorEvent

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

Constant detail
NO_CACHE_VARIABLE_NAMEconstant
public static const NO_CACHE_VARIABLE_NAME:String = "noCache"

Name of the 'no cache' variable.