Packageaway3dlite.loaders
Classpublic class AWData
InheritanceAWData Inheritance AbstractParser Inheritance flash.events.EventDispatcher

File loader/parser for the native .awd data file format.

Public Properties
 PropertyDefined by
 Inheritedcontainer : Object3D
Retuns a 3d container object used for storing the parsed 3d object.
AbstractParser
 InheritedgeometryLibrary : GeometryLibrary
Retuns a geometryLibrary object used for storing the parsed geometry data.
AbstractParser
 Inheritedmaterial : Material
Overrides all materials in the model.
AbstractParser
 InheritedmaterialLibrary : MaterialLibrary
Retuns a materialLibrary object used for storing the parsed material objects.
AbstractParser
 Inheritedmaterials : Object
Overides materials in the model using name:value pairs.
AbstractParser
 InheritedparsedChunks : int
Returns the total number of data chunks parsed
AbstractParser
 InheritedparseTimeout : int = 40000
Defines a timeout period for file parsing (in milliseconds).
AbstractParser
  pathToSources : String
[write-only] Allows to set custom path to source(s) map(s) other than set in file Standard output url from Prefab awd files is "images/filename.jpg" when set pathToSources, url becomes [newurl]filename.jpg.
AWData
 InheritedtotalChunks : int
Returns the total number of data chunks available
AbstractParser
Public Methods
 MethodDefined by
  
AWData
()
Creates a new AWData object, a parser for .awd files.
AWData
 Inherited
addOnError(listener:Function):void
Default method for adding a parseError event listener
AbstractParser
 Inherited
addOnProgress(listener:Function):void
Default method for adding a parseProgress event listener
AbstractParser
 Inherited
addOnSuccess(listener:Function):void
Default method for adding a parseSuccess event listener
AbstractParser
  
parse(data:*, sourcesUrl:String = ""):Object3D
[static] Parses and creates an Object3D from the raw ascii data of an .awd file.
AWData
 Inherited
Parses 3d file data.
AbstractParser
 Inherited
removeOnError(listener:Function):void
Default method for removing a parseError event listener
AbstractParser
 Inherited
removeOnProgress(listener:Function):void
Default method for removing a parseProgress event listener
AbstractParser
 Inherited
removeOnSuccess(listener:Function):void
Default method for removing a parseSuccess event listener
AbstractParser
Events
 EventSummaryDefined by
 Inherited Dispatched when the 3d object parser fails to parse a file.AbstractParser
 Inherited Dispatched when the 3d object parser progresses by one chunk.AbstractParser
 Inherited Dispatched when the 3d object parser completes a file parse successfully.AbstractParser
Property detail
pathToSourcesproperty
pathToSources:String  [write-only]

Allows to set custom path to source(s) map(s) other than set in file Standard output url from Prefab awd files is "images/filename.jpg" when set pathToSources, url becomes [newurl]filename.jpg. Example: AWData.pathToSources = "mydisc/myfiles/"; Only required for load method using Loader3D var awd:AWData = new AWData(); awd.pathToSources = "mydisc/myfiles/"; loader = new Loader3D(); loader.addEventListener(Loader3DEvent.LOAD_SUCCESS, onSuccess); loader.loadGeometry("mymodels/car.awd", awd);

Implementation
    public function set pathToSources(value:String):void
Constructor detail
AWData()constructor
public function AWData() Init Parameters

See also

Method detail
parse()method
public static function parse(data:*, sourcesUrl:String = ""):Object3D

Parses and creates an Object3D from the raw ascii data of an .awd file. The Away3D native.awd data files. Exporters to awd format are available in Away3d exporters package and in PreFab3D export options

Parameters
data:* — The ascii data of a .awd file.
 
sourcesUrl:String (default = "") — [optional] If the url for the source materials muts be changed. Standard urls set for image sources from Prefab3D awd exports is "images/filename.jpg" Example: [Embed(source="aircraft/Aircraft.awd", mimeType="application/octet-stream")] private var Aircraft:Class; [...] awaylite code var myoutput:Object3D = AWData.parse(new Aircraft(), "mydisc/myfiles/");//path becomes then "mydisc/myfiles/filename.jpg" scene.addChild(myoutput);

Returns
Object3D — An Object3D representation of the .awd file.
Wiki link
Click to go to the wiki page for 'away3dlite.loaders.AWData'

Code examples

Comments