Packageaway3d.loaders
Classpublic class AbstractParser
InheritanceAbstractParser Inheritance flash.events.EventDispatcher
SubclassesAse, Collada, Kmz, Max3DS, Md2, Md2still, Obj, Swf

Abstract parsing object used as a base class for all loaders to extend from.

Public Properties
 PropertyDefined by
  container : Object3D
3d container object used for storing the parsed 3d object.
AbstractParser
  parsedChunks : int
[read-only] Returns the total number of data chunks parsed
AbstractParser
  parseTimeout : int
Defines a timeout period for file parsing (in milliseconds).
AbstractParser
  totalChunks : int
[read-only] Returns the total number of data chunks available
AbstractParser
Protected Properties
 PropertyDefined by
  ini : Init
Instance of the Init object used to hold and parse default property values specified by the initialiser object in the parser constructor.
AbstractParser
Public Methods
 MethodDefined by
  
AbstractParser
(init:Object = null)
Creates a new AbstractParser object.
AbstractParser
  
addOnError(listener:Function):void
Default method for adding a parseError event listener
AbstractParser
  
addOnProgress(listener:Function):void
Default method for adding a parseProgress event listener
AbstractParser
  
addOnSuccess(listener:Function):void
Default method for adding a parseSuccess event listener
AbstractParser
  
parse(data:*):Object3D
Parses 3d file data.
AbstractParser
  
removeOnError(listener:Function):void
Default method for removing a parseError event listener
AbstractParser
  
removeOnProgress(listener:Function):void
Default method for removing a parseProgress event listener
AbstractParser
  
removeOnSuccess(listener:Function):void
Default method for removing a parseSuccess event listener
AbstractParser
Events
 EventSummaryDefined by
   Dispatched when the 3d object parser fails to parse a file.AbstractParser
   Dispatched when the 3d object parser progresses by one chunk.AbstractParser
   Dispatched when the 3d object parser completes a file parse successfully.AbstractParser
Property detail
containerproperty
public var container:Object3D

3d container object used for storing the parsed 3d object.

iniproperty 
protected var ini:Init

Instance of the Init object used to hold and parse default property values specified by the initialiser object in the parser constructor.

parsedChunksproperty 
parsedChunks:int  [read-only]

Returns the total number of data chunks parsed

Implementation
    public function get parsedChunks():int
parseTimeoutproperty 
public var parseTimeout:int

Defines a timeout period for file parsing (in milliseconds).

totalChunksproperty 
totalChunks:int  [read-only]

Returns the total number of data chunks available

Implementation
    public function get totalChunks():int
Constructor detail
AbstractParser()constructor
public function AbstractParser(init:Object = null)Parameters
init:Object (default = null) — [optional] An initialisation object for specifying default instance properties.
Init Parameters
 parseTimeout:Number (default = 40000)
Method detail
addOnError()method
public function addOnError(listener:Function):void

Default method for adding a parseError event listener

Parameters
listener:Function — The listener function
addOnProgress()method 
public function addOnProgress(listener:Function):void

Default method for adding a parseProgress event listener

Parameters
listener:Function — The listener function
addOnSuccess()method 
public function addOnSuccess(listener:Function):void

Default method for adding a parseSuccess event listener

Parameters
listener:Function — The listener function
parse()method 
public function parse(data:*):Object3D

Parses 3d file data.

Parameters
data:* — The file data to be parsed. Can be in text or binary form.

Returns
Object3D — The parsed 3d object.
removeOnError()method 
public function removeOnError(listener:Function):void

Default method for removing a parseError event listener

Parameters
listener:Function — The listener function
removeOnProgress()method 
public function removeOnProgress(listener:Function):void

Default method for removing a parseProgress event listener

Parameters
listener:Function — The listener function
removeOnSuccess()method 
public function removeOnSuccess(listener:Function):void

Default method for removing a parseSuccess event listener

Parameters
listener:Function — The listener function
Event detail
parseErrorevent 
Event object type: away3d.events.ParserEvent

Dispatched when the 3d object parser fails to parse a file.

parseProgressevent  
Event object type: away3d.events.ParserEvent

Dispatched when the 3d object parser progresses by one chunk.

parseSuccessevent  
Event object type: away3d.events.ParserEvent

Dispatched when the 3d object parser completes a file parse successfully.

Wiki link
Click to go to the wiki page for 'away3d.loaders.AbstractParser'

Code examples

Comments