Packageaway3d.loading
Classpublic class AssetLoader
InheritanceAssetLoader Inheritance flash.events.EventDispatcher

The AssetLoader is used to load resources natively supported by Away3D, such as scene graph objects (Mesh, ObjectContainer3D, Scene3D, etc), materials, animations, ... It supports autodetection of the following file types: For other types, if a parser is available, or when specific options need to be passed to it, the parser should be passed using the load or loadData methods. While AssetLoader can be used directly, it's recommended to use the ResourceManager class instead.

See also

away3d.loading.ResourceManager
Public Properties
 PropertyDefined by
  dependencies : Vector
[read-only] A list of dependencies that need to be loaded and resolved for the loaded object.
AssetLoader
  eventVerbosity : int
The threshold that define which events are dispatched.
AssetLoader
  handle : IResource
[read-only] The object that will contain all the loaded and parsed data.
AssetLoader
  parser : ParserBase
[read-only] A reference to the parser that will translate the loaded data into a usable resource.
AssetLoader
Public Methods
 MethodDefined by
  
Creates a new AssetLoader object.
AssetLoader
  
load(urlRequest:URLRequest, parser:Class = null):void
Load a resource from a file.
AssetLoader
  
parseData(data:*, uri:String, parser:Class = null):void
Loads a resource from already loaded data.
AssetLoader
Public Constants
 ConstantDefined by
  LEVEL_1 : int = 1
[static]
AssetLoader
  LEVEL_2 : int = 2
[static]
AssetLoader
  SILENT : int = 0
[static]
AssetLoader
Property detail
dependenciesproperty
dependencies:Vector  [read-only]

A list of dependencies that need to be loaded and resolved for the loaded object.

Implementation
    public function get dependencies():Vector
eventVerbosityproperty 
eventVerbosity:int  [read-write]

The threshold that define which events are dispatched.

Implementation
    public function get eventVerbosity():int
    public function set eventVerbosity(value:int):void
handleproperty 
handle:IResource  [read-only]

The object that will contain all the loaded and parsed data.

Implementation
    public function get handle():IResource
parserproperty 
parser:ParserBase  [read-only]

A reference to the parser that will translate the loaded data into a usable resource.

Implementation
    public function get parser():ParserBase
Constructor detail
AssetLoader()constructor
public function AssetLoader() Init Parameters
Method detail
load()method
public function load(urlRequest:URLRequest, parser:Class = null):void

Load a resource from a file.

Parameters
urlRequest:URLRequest — The URLRequest object containing the URL of the object to be loaded.
 
parser:Class (default = null) — 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()method 
public function parseData(data:*, uri:String, parser:Class = null):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:String — The identifier (url or id) of the object to be loaded, mainly used for resource management.
 
parser:Class (default = null) — 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.
Constant detail
LEVEL_1constant
public static const LEVEL_1:int = 1
LEVEL_2constant 
public static const LEVEL_2:int = 2
SILENTconstant 
public static const SILENT:int = 0
Wiki link
Click to go to the wiki page for 'away3d.loading.AssetLoader'

Code examples

Comments