Packageaway3d.loading
Classpublic class ResourceDependency

ResourceDependency represents the data required to load, parse and resolve additional files ("dependencies") required by a parser, used by ResourceLoadSession.

See also

away3d.loading.ResourceManager
away3d.loading.ResourceLoadSession
Public Properties
 PropertyDefined by
  data : *
[read-only] The data containing the dependency to be parsed, if the resource was already loaded.
ResourceDependency
  id : String
[read-only] The id of the dependency.
ResourceDependency
  parentParser : ParserBase
[read-only] The parser which is dependent on this ResourceDependency object.
ResourceDependency
  resource : IResource
The loaded and parsed resource.
ResourceDependency
  url : String
[read-only] The url of the dependency.
ResourceDependency
Public Methods
 MethodDefined by
  
ResourceDependency
(id:String, url:String, data:ParserBase, parentParser:*)
Creates a new ResourceDependency object.
ResourceDependency
  
resolve():void
Resolve the dependency when it's loaded with the parent parser.
ResourceDependency
  
Resolve a dependency failure.
ResourceDependency
Property detail
dataproperty
data:*  [read-only]

The data containing the dependency to be parsed, if the resource was already loaded.

Implementation
    public function get data():*
idproperty 
id:String  [read-only]

The id of the dependency.

Implementation
    public function get id():String
parentParserproperty 
parentParser:ParserBase  [read-only]

The parser which is dependent on this ResourceDependency object.

Implementation
    public function get parentParser():ParserBase
resourceproperty 
resource:IResource  [read-write]

The loaded and parsed resource.

Implementation
    public function get resource():IResource
    public function set resource(value:IResource):void
urlproperty 
url:String  [read-only]

The url of the dependency.

Implementation
    public function get url():String
Constructor detail
ResourceDependency()constructor
public function ResourceDependency(id:String, url:String, data:ParserBase, parentParser:*)Parameters
id:String — The id of the dependency.
 
url:String — The url of the dependency, if the resource needs to be loaded.
 
data:ParserBase — The data containing the dependency to be parsed, if the resource was already loaded.
 
parentParser:* — The parser which is dependent on this ResourceDependency object.
Init Parameters
Method detail
resolve()method
public function resolve():void

Resolve the dependency when it's loaded with the parent parser. For example, a dependency containing an ImageResource would be assigned to a Mesh instance as a BitmapMaterial, a scene graph object would be added to its intended parent. The dependency should be a member of the dependencies property.

resolveFailure()method 
public function resolveFailure():void

Resolve a dependency failure. For example, map loading failure from a 3d file

Wiki link
Click to go to the wiki page for 'away3d.loading.ResourceDependency'

Code examples

Comments