| Package | ch.capi.net |
| Class | public class LoadableFileFactory |
| Inheritance | LoadableFileFactory Object |
ILoadableFile objects.
See also
| Property | Defined By | ||
|---|---|---|---|
| alwaysUseCache : Boolean
Defines if all the ILoadableFile instances will use the cache or not. | LoadableFileFactory | ||
| applicationDomainPolicy : String = null
Defines the ApplicationDomain policy. | LoadableFileFactory | ||
| basePath : String = null
Defines the base path that will be used as prefix when a URLRequest is created. | LoadableFileFactory | ||
| contextPolicy : IContextPolicy
Defines the IContextPolicy that will be used to create the
LoaderContext and SoundLoaderContext objects. | LoadableFileFactory | ||
| defaultLoadableFileFactory : LoadableFileFactory [static] [read-only]
Defines the default LoadableFileFactory. | LoadableFileFactory | ||
| defaultVariables : IMap
Defines the default variables that will be used by the created ILoadableFile instances as
parent IMap. | LoadableFileFactory | ||
| defaultVirtualBytesTotal : uint
Defines the default virtual bytes to set to the created ILoadableFile
objects. | LoadableFileFactory | ||
| fileTypeSelector : FileTypeSelector
Defines the FileTypeSelector that will be used when the
createFile method is called. | LoadableFileFactory | ||
| listenersPriority : int
Defines the listeners priority when the attachListeners method is used. | LoadableFileFactory | ||
| securityDomainPolicy : String = null
Defines the SecurityDomain policy. | LoadableFileFactory | ||
| Method | Defined By | ||
|---|---|---|---|
LoadableFileFactory(alwaysUseCache:Boolean = false, defaultVirtualBytesTotal:uint = 204800, listenersPriority:int = 0)
Creates a new LoadableFileFactory object. | LoadableFileFactory | ||
attachListeners(file:ILoadableFile, onOpen:Function = null, onProgress:Function = null, onComplete:Function = null, onClose:Function = null, onIOError:Function = null, onSecurityError:Function = null):void
Creates the listeners on a ILoadManager object. | LoadableFileFactory | ||
Creates a clone of the current LoadableFileFactory. | LoadableFileFactory | ||
create(url:Object, type:String = null, onOpen:Function = null, onProgress:Function = null, onComplete:Function = null, onClose:Function = null, onIOError:Function = null, onSecurityError:Function = null):ILoadableFile [static]
Creates a ILoadableFile object. | LoadableFileFactory | ||
createFile(url:Object, type:String = null, onOpen:Function = null, onProgress:Function = null, onComplete:Function = null, onClose:Function = null, onIOError:Function = null, onSecurityError:Function = null):ILoadableFile
Creates a ILoadableFile directly from an url. | LoadableFileFactory | ||
createLoaderFile(request:URLRequest = null, context:LoaderContext = null):LoaderFile
Create a ILoadableFile associated to a Loader object. | LoadableFileFactory | ||
createSoundFile(request:URLRequest = null, context:SoundLoaderContext = null):SoundFile
Creates a ILoadableFile associated to a Sound
object. | LoadableFileFactory | ||
createURLLoaderFile(request:URLRequest = null, dataFormat:String = null):URLLoaderFile
Creates a ILoadableFile associated to a URLLoader
object. | LoadableFileFactory | ||
createURLStreamFile(request:URLRequest = null):URLStreamFile
Creates a ILoadableFile associated to a URLStream
object. | LoadableFileFactory | ||
getRequest(url:Object):URLRequest [static]
Creates a URLRequest from a url object. | LoadableFileFactory | ||
| Method | Defined By | ||
|---|---|---|---|
getMethod(type:String):Function
Retrieves the method to call within the specified type to create a ILoadableFile. | LoadableFileFactory | ||
initializeFile(file:ILoadableFile):void
Initialize the default data of the specified ILoadableFile. | LoadableFileFactory | ||
| alwaysUseCache | property |
alwaysUseCache:Boolean [read-write]
Defines if all the ILoadableFile instances will use the cache or not. If
false, the the ILoadableFile.useCache property will be true
only if there is a variable in its URL.
public function get alwaysUseCache():Boolean public function set alwaysUseCache(value:Boolean):void| applicationDomainPolicy | property |
public var applicationDomainPolicy:String = null
Defines the ApplicationDomain policy. The value must be
issued from the DomainUtils constants or null.
See also
| basePath | property |
public var basePath:String = null
Defines the base path that will be used as prefix when a URLRequest is created.
See also
| contextPolicy | property |
contextPolicy:IContextPolicy [read-write]
Defines the IContextPolicy that will be used to create the
LoaderContext and SoundLoaderContext objects. This
value is never null.
public function get contextPolicy():IContextPolicy public function set contextPolicy(value:IContextPolicy):void| defaultLoadableFileFactory | property |
defaultLoadableFileFactory:LoadableFileFactory [read-only]
Defines the default LoadableFileFactory.
public static function get defaultLoadableFileFactory():LoadableFileFactorySee also
| defaultVariables | property |
defaultVariables:IMap [read-write]
Defines the default variables that will be used by the created ILoadableFile instances as
parent IMap. The LoadableFileFactory will create a TreeMap for each
ILoadableFile with this IMap as parent. This value is never null.
public function get defaultVariables():IMap public function set defaultVariables(value:IMap):voidSee also
| defaultVirtualBytesTotal | property |
defaultVirtualBytesTotal:uint [read-write]
Defines the default virtual bytes to set to the created ILoadableFile
objects.
public function get defaultVirtualBytesTotal():uint public function set defaultVirtualBytesTotal(value:uint):voidSee also
| fileTypeSelector | property |
fileTypeSelector:FileTypeSelector [read-write]
Defines the FileTypeSelector that will be used when the
createFile method is called. This value is never null.
By default, this value is intialized by the default FileTypeSelector.
public function get fileTypeSelector():FileTypeSelector public function set fileTypeSelector(value:FileTypeSelector):voidSee also
| listenersPriority | property |
listenersPriority:int [read-write]
Defines the listeners priority when the attachListeners method is used.
public function get listenersPriority():int public function set listenersPriority(value:int):void| securityDomainPolicy | property |
public var securityDomainPolicy:String = null
Defines the SecurityDomain policy. The value must be
issued from the DomainUtils constants or null.
See also
| LoadableFileFactory | () | Constructor |
public function LoadableFileFactory(alwaysUseCache:Boolean = false, defaultVirtualBytesTotal:uint = 204800, listenersPriority:int = 0)
Creates a new LoadableFileFactory object.
alwaysUseCache:Boolean (default = false) — Indicates if the ILoadableFile.useCache
property will be always true. Otherwise it
will be true only if there is a variable in
the URL.
| |
defaultVirtualBytesTotal:uint (default = 204800) — The virtual bytes to set by default to the
created ILoadableFile objects.
| |
listenersPriority:int (default = 0) — Defines the listeners priority when the attachListeners
method is used.
|
| attachListeners | () | method |
public function attachListeners(file:ILoadableFile, onOpen:Function = null, onProgress:Function = null, onComplete:Function = null, onClose:Function = null, onIOError:Function = null, onSecurityError:Function = null):void
Creates the listeners on a ILoadManager object.
Parameters
file:ILoadableFile — The ILoadManager to listen.
| |
onOpen:Function (default = null) — The Event.OPEN listener.
| |
onProgress:Function (default = null) — The ProgressEvent.PROGRESS listener.
| |
onComplete:Function (default = null) — The Event.COMPLETE listener.
| |
onClose:Function (default = null) — The Event.CLOSE listener.
| |
onIOError:Function (default = null) — The IOErrorEvent.IO_ERROR listener.
| |
onSecurityError:Function (default = null) — The SecurityErrorEvent.SECURITY_ERROR listener.
|
See also
| clone | () | method |
public function clone():LoadableFileFactory
Creates a clone of the current LoadableFileFactory. This method will only clone the
current LoadableFileFactory and report its references in the new one.
LoadableFileFactory — The cloned LoadableFileFactory.
|
| create | () | method |
public static function create(url:Object, type:String = null, onOpen:Function = null, onProgress:Function = null, onComplete:Function = null, onClose:Function = null, onIOError:Function = null, onSecurityError:Function = null):ILoadableFile
Creates a ILoadableFile object.
Parameters
url:Object — The url of the file.
| |
type:String (default = null) — The file type issued from the LoadableFileType constants.
| |
onOpen:Function (default = null) — The Event.OPEN listener.
| |
onProgress:Function (default = null) — The ProgressEvent.PROGRESS listener.
| |
onComplete:Function (default = null) — The Event.COMPLETE listener.
| |
onClose:Function (default = null) — The Event.CLOSE listener.
| |
onIOError:Function (default = null) — The IOErrorEvent.IO_ERROR listener.
| |
onSecurityError:Function (default = null) — The SecurityErrorEvent.SECURITY_ERROR listener.
|
ILoadableFile — The created ILoadableFile object.
|
See also
| createFile | () | method |
public function createFile(url:Object, type:String = null, onOpen:Function = null, onProgress:Function = null, onComplete:Function = null, onClose:Function = null, onIOError:Function = null, onSecurityError:Function = null):ILoadableFile
Creates a ILoadableFile directly from an url.
Parameters
url:Object — The url. If a basePath is set, then the url will be basePath + url.
| |
type:String (default = null) — The file type issued from the LoadableFileType constants.
| |
onOpen:Function (default = null) — The Event.OPEN listener.
| |
onProgress:Function (default = null) — The ProgressEvent.PROGRESS listener.
| |
onComplete:Function (default = null) — The Event.COMPLETE listener.
| |
onClose:Function (default = null) — The Event.CLOSE listener.
| |
onIOError:Function (default = null) — The IOErrorEvent.IO_ERROR listener.
| |
onSecurityError:Function (default = null) — The SecurityErrorEvent.SECURITY_ERROR listener.
|
ILoadableFile — The ILoadableFile object created.
|
See also
| createLoaderFile | () | method |
public function createLoaderFile(request:URLRequest = null, context:LoaderContext = null):LoaderFile
Create a ILoadableFile associated to a Loader object.
Parameters
request:URLRequest (default = null) — The url request.
| |
context:LoaderContext (default = null) — The LoaderContext.
|
LoaderFile — The ILoadableFile object created.
|
| createSoundFile | () | method |
public function createSoundFile(request:URLRequest = null, context:SoundLoaderContext = null):SoundFile
Creates a ILoadableFile associated to a Sound
object.
Parameters
request:URLRequest (default = null) — The url request.
| |
context:SoundLoaderContext (default = null) — The SoundLoaderContext.
|
SoundFile — The ILoadableFile object created.
|
| createURLLoaderFile | () | method |
public function createURLLoaderFile(request:URLRequest = null, dataFormat:String = null):URLLoaderFile
Creates a ILoadableFile associated to a URLLoader
object.
Parameters
request:URLRequest (default = null) — The url request.
| |
dataFormat:String (default = null) — The format of the data issued from the URLLoaderDataFormat constants.
|
URLLoaderFile — The ILoadableFile object created.
|
| createURLStreamFile | () | method |
public function createURLStreamFile(request:URLRequest = null):URLStreamFile
Creates a ILoadableFile associated to a URLStream
object.
Parameters
request:URLRequest (default = null) — The url request.
|
URLStreamFile — The ILoadableFile object created.
|
| getMethod | () | method |
protected function getMethod(type:String):Function
Retrieves the method to call within the specified type to create a ILoadableFile. All functions
returned by this method take a URLRequest as first argument.
Parameters
type:String — The type issued from the LoadableFileType constants.
|
Function — The method to call.
|
ArgumentError If — the type is invalid.
|
| getRequest | () | method |
public static function getRequest(url:Object):URLRequest
Creates a URLRequest from a url object. If the url is a URLRequest, then it is simply
returned. If the url is a String, it is encapsulated in a new URLRequest. Otherwise, an
error is thrown.
Parameters
url:Object — The url object.
|
URLRequest — The created URLRequest object.
|
ArgumentError If — the url is not a URLRequest nor a String.
|
| initializeFile | () | method |
protected function initializeFile(file:ILoadableFile):void
Initialize the default data of the specified ILoadableFile.
Parameters
file:ILoadableFile — The ILoadableFile to initialize.
|
var file1:ILoadableFile = LoadableFileFactory.create("file.swf"); //use a Loader
var file2:ILoadableFile = LoadableFileFactory.create("file.swf", LoadableFileType.BINARY); //use a URLLoader with URLLoaderDataFormat.BINARY
var myRequest:URLRequest = new URLRequest("file.txt");
var file3:ILoadableFile = LoadableFileFactory.create(myRequest);