class SingleFileLoader
package away3d.loaders.misc
extends EventDispatcher
Available on all platforms
The SingleFileLoader is used to load a single file, as part of a resource.
While SingleFileLoader can be used directly, e.g. to create a third-party asset management system, it's recommended to use any of the classes Loader3D, AssetLoader and Asset3DLibrary instead in most cases.
See also:
away3d.loading.Loader3D
away3d.loading.AssetLoader
away3d.loading.Asset3DLibrary
Static methods
Constructor
Variables
read onlydependencies:Vector<ResourceDependency>
A list of dependencies that need to be loaded and resolved for the loaded object.
read onlyparser:ParserBase
A reference to the parser that will translate the loaded data into a usable resource.
Methods
load(urlRequest:URLRequest, ?parser:ParserBase, loadAsRawData:Bool = false):Void
Load a resource from a file.
Parameters:
urlRequest | The URLRequest object containing the URL of the object to be loaded. |
|---|---|
parser | An optional parser object that will translate the loaded data into a usable resource. If not provided, AssetLoader will attempt to auto-detect the file type. |
parseData(data:Dynamic, ?parser:ParserBase, ?req:URLRequest):Void
Loads a resource from already loaded data.
Parameters:
data | The data to be parsed. Depending on the parser type, this can be a ByteArray, String or XML. |
|---|---|
uri | The identifier (url or id) of the object to be loaded, mainly used for resource management. |
parser | An optional parser object that will translate the data into a usable resource. If not provided, AssetLoader will attempt to auto-detect the file type. |