| Package | ch.capi.net |
| Class | public class LoadableFileFactory |
ILoadableFile objects.
LoableFileFactory :
var factory:LoadableFileFactory = new LoadableFileFactory();
var file:ILoadableFile = factory.create("myFile.swf"); //creates a Loader-based ILoadableFile
//retrieves the load manager object
var lo:Loader = file.loadManagerObject as Loader;
LoableFileFactory :
var selector:ExtensionFileSelector = new ExtensionFileSelector();
selector.extensions.put("swf", LoadableFileType.BINARY);
var factory:LoadableFileFactory = new LoadableFileFactory(selector);
var file:ILoadableFile = factory.create("myFile.swf"); //creates a binary URLLoader-based ILoadableFile
//retrieves the load manager object
var ulo:URLLoader = file.loadManagerObject as URLLoader;
See also
| Property | Defined by | ||
|---|---|---|---|
| basePath : String = "null"
Defines the base path that will be used as prefix when a
URLRequest is created. | LoadableFileFactory | ||
| defaultLoaderContext : LoaderContext
Defines the default
LoaderContext that will be used to create a ILoadableFile
based on a Loader object. | LoadableFileFactory | ||
| defaultSoundLoaderContext : SoundLoaderContext
Defines the defaut
SoundLoaderContext that will be used to create a ILoadableFile
based on a Sound object. | LoadableFileFactory | ||
| defaultUseCache : Boolean
Defines if the
ILoadableFile created will use the
cache or not. | LoadableFileFactory | ||
| defaultVirtualBytesTotal : uint
Defines the default virtual bytes to set to the created
ILoadableFile
objects. | LoadableFileFactory | ||
| listenersPriority : int
Defines the listeners priority when the
attachListeners method is used. | LoadableFileFactory | ||
| loadableFileSelector : ILoadableFileSelector
Defines the
ILoadableFileSelector that will be used when the
create or createFile method is called. | LoadableFileFactory | ||
| Method | Defined by | ||
|---|---|---|---|
|
LoadableFileFactory(fileSelector:ILoadableFileSelector = null, defaultUseCache:Boolean = true, 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 | ||
|
create(url:String, 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 | ||
|
createFile(request:URLRequest, onOpen:Function = null, onProgress:Function = null, onComplete:Function = null, onClose:Function = null, onIOError:Function = null, onSecurityError:Function = null):ILoadableFile
Creates a
ILoadableFile using the defined ILoadableFileSelector to determine
which type of ILoadableFile to create. | LoadableFileFactory | ||
|
createLoaderFile(request:URLRequest = null, context:LoaderContext = null):ILoadableFile
Create a
ILoadableFile associated to a Loader object. | LoadableFileFactory | ||
|
createSoundFile(request:URLRequest = null, context:SoundLoaderContext = null):ILoadableFile
Creates a
ILoadableFile associated to a Sound
object. | LoadableFileFactory | ||
|
createURLLoaderFile(request:URLRequest = null, dataFormat:String = null):ILoadableFile
Creates a
ILoadableFile associated to a URLLoader
object. | LoadableFileFactory | ||
|
createURLStreamFile(request:URLRequest = null):ILoadableFile
Creates a
ILoadableFile associated to a URLStream
object. | LoadableFileFactory | ||
| Method | Defined by | ||
|---|---|---|---|
|
initializeFile(file:ILoadableFile):void
Initialize the default data of the specified
ILoadableFile. | LoadableFileFactory | ||
| basePath | property |
public var basePath:String = "null"
Defines the base path that will be used as prefix when a URLRequest is created.
See also
| defaultLoaderContext | property |
defaultLoaderContext:LoaderContext [read-write]
Defines the default LoaderContext that will be used to create a ILoadableFile
based on a Loader object.
public function get defaultLoaderContext():LoaderContext
public function set defaultLoaderContext(value:LoaderContext):void
See also
| defaultSoundLoaderContext | property |
defaultSoundLoaderContext:SoundLoaderContext [read-write]
Defines the defaut SoundLoaderContext that will be used to create a ILoadableFile
based on a Sound object.
public function get defaultSoundLoaderContext():SoundLoaderContext
public function set defaultSoundLoaderContext(value:SoundLoaderContext):void
See also
| defaultUseCache | property |
defaultUseCache:Boolean [read-write]
Defines if the ILoadableFile created will use the
cache or not.
public function get defaultUseCache():Boolean
public function set defaultUseCache(value:Boolean):void
See 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):void
See 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
| loadableFileSelector | property |
loadableFileSelector:ILoadableFileSelector [read-write]
Defines the ILoadableFileSelector that will be used when the
create or createFile method is called.
public function get loadableFileSelector():ILoadableFileSelector
public function set loadableFileSelector(value:ILoadableFileSelector):void
See also
| LoadableFileFactory | () | constructor |
public function LoadableFileFactory(fileSelector:ILoadableFileSelector = null, defaultUseCache:Boolean = true, defaultVirtualBytesTotal:uint = 204800, listenersPriority:int = 0)
Creates a new LoadableFileFactory object.
fileSelector:ILoadableFileSelector (default = null) — The ILoadableFileSelector. By default, a ExtensionFileSelector
will be created.
|
|
defaultUseCache:Boolean (default = true) — Indicates if the ILoadableFile
will use the cache or not.
|
|
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.
|
See also
| 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.
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
| create | () | method |
public function create(url:String, 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. This method will simply
create a URLRequest object and return the ILoadableFile retrieved
by the createFile() method.
url:String — The url. If a basePath is set, then the url will be basePath + url.
|
|
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
| createFile | () | method |
public function createFile(request:URLRequest, onOpen:Function = null, onProgress:Function = null, onComplete:Function = null, onClose:Function = null, onIOError:Function = null, onSecurityError:Function = null):ILoadableFile
Creates a ILoadableFile using the defined ILoadableFileSelector to determine
which type of ILoadableFile to create.
request:URLRequest — The url request.
|
|
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 or null if the
ILoadableFile has not been created.
|
See also
| createLoaderFile | () | method |
public function createLoaderFile(request:URLRequest = null, context:LoaderContext = null):ILoadableFile
Create a ILoadableFile associated to a Loader object.
request:URLRequest (default = null) — The url request.
|
|
context:LoaderContext (default = null) — The LoaderContext.
|
ILoadableFile —
The ILoadableFile object created.
|
| createSoundFile | () | method |
public function createSoundFile(request:URLRequest = null, context:SoundLoaderContext = null):ILoadableFile
Creates a ILoadableFile associated to a Sound
object.
request:URLRequest (default = null) — The url request.
|
|
context:SoundLoaderContext (default = null) — The SoundLoaderContext.
|
ILoadableFile —
The ILoadableFile object created.
|
| createURLLoaderFile | () | method |
public function createURLLoaderFile(request:URLRequest = null, dataFormat:String = null):ILoadableFile
Creates a ILoadableFile associated to a URLLoader
object.
request:URLRequest (default = null) — The url request.
|
|
dataFormat:String (default = null) — The format of the data issued from the URLLoaderDataFormat constants.
|
ILoadableFile —
The ILoadableFile object created.
|
| createURLStreamFile | () | method |
public function createURLStreamFile(request:URLRequest = null):ILoadableFile
Creates a ILoadableFile associated to a URLStream
object.
request:URLRequest (default = null) — The url request.
|
ILoadableFile —
The ILoadableFile object created.
|
| initializeFile | () | method |
protected function initializeFile(file:ILoadableFile):void
Initialize the default data of the specified ILoadableFile.
file:ILoadableFile — The ILoadableFile to initialize.
|