Packageaway3d.loading.parsers
Classpublic class AWD1Parser
InheritanceAWD1Parser Inheritance ParserBase Inheritance flash.events.EventDispatcher

AWD1Parser provides a parser for the AWD data type. The version 1.0 in ascii. Usually generated by Prefab3d 1.x and Away3D engine <4.0 exporters

Public Properties
 PropertyDefined by
 InheritedbaseUri : String
The parent url of the file to be parsed.
ParserBase
 InheriteddataFormat : String
The data format of the file data to be parsed.
ParserBase
 InheriteddefaultBitmapData : BitmapData
The url or id of the data or file to be parsed.
ParserBase
 Inheriteddependencies : Vector
A list of dependencies that need to be loaded and resolved for the object being parsed.
ParserBase
 InheritedeventVerbosity : int
The threshold that define which events are dispatched.
ParserBase
 Inheritedhandle : IResource
The object that will contain all the parsed data.
ParserBase
 InheritedparsingFailure : Boolean
ParserBase
 Inheriteduri : String
The url or id of the data or file to be parsed.
ParserBase
Protected Properties
 PropertyDefined by
 Inherited_byteData : ByteArray
ParserBase
 Inherited_dataFormat : String
ParserBase
 Inherited_dependencies : Vector
A list of dependencies that need to be loaded and resolved for the object being parsed.
ParserBase
 Inherited_frameLimit : Number
ParserBase
 Inherited_lastFrameTime : Number
ParserBase
 Inherited_textData : String
ParserBase
Public Methods
 MethodDefined by
  
AWD1Parser
(uri:String = "")
Creates a new AWD1Parser object.
AWD1Parser
 Inherited
isBitmapDataValid(bitmapData:BitmapData):Boolean
Validates a bitmapData loaded before assigning to a default BitmapMaterial
ParserBase
 Inherited
parseBytesAsync(bytes:ByteArray, frameLimit:Number = 30):void
Parse byte array (possibly containing plain text) asynchronously, meaning that the parser will periodically stop parsing so that the AVM may proceed to the next frame.
ParserBase
 Inherited
parseTextAsync(str:String, frameLimit:Number = 30):void
Parse plaintext string asynchronously, meaning that the parser will periodically stop parsing so that the AVM may proceed to the next frame.
ParserBase
  
supportsData(data:*):Boolean
[static] Tests whether a data block can be parsed by the parser.
AWD1Parser
  
supportsType(extension:String):Boolean
[static] Indicates whether or not a given file extension is supported by the parser.
AWD1Parser
Protected Methods
 MethodDefined by
 Inherited
finishParsing():void
Finish parsing the data.
ParserBase
 Inherited
hasTime():Boolean
Tests whether or not there is still time left for parsing within the maximum allowed time frame per session.
ParserBase
  
Creates the object that will be returned to the user and will contain all the loaded data.
AWD1Parser
 Inherited
onInterval(event:TimerEvent = null):void
Called when the parsing pause interval has passed and parsing can proceed.
ParserBase
  
proceedParsing():Boolean
Parse the next block of data.
AWD1Parser
Protected Constants
 ConstantDefined by
 InheritedMORE_TO_PARSE : Boolean = false
[static] Returned by proceedParsing to indicate more parsing is needed, allowing asynchronous parsing.
ParserBase
 InheritedPARSING_DONE : Boolean = true
[static] Returned by proceedParsing to indicate no more parsing is needed.
ParserBase
Constructor detail
AWD1Parser()constructor
public function AWD1Parser(uri:String = "")Parameters
uri:String (default = "") — The url or id of the data or file to be parsed.
Init Parameters
Method detail
initHandle()method
protected override function initHandle():IResource

Creates the object that will be returned to the user and will contain all the loaded data. This allows ResourceManager to return an object handle regardless of whether the object was loaded or not, which in turn allows users to add objects to the scene or assign materials before they are actually loaded. This method needs to be overridden by concrete subclasses.

Returns
IResource — A reference to the handle.
proceedParsing()method 
protected override function proceedParsing():Boolean

Parse the next block of data.

Returns
Boolean — Whether or not more data needs to be parsed. Can be ParserBase.PARSING_DONE or ParserBase.MORE_TO_PARSE.
resolveDependency()method 
arcane override function resolveDependency(resourceDependency:ResourceDependency):void

Resolve a dependency when it's loaded. 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.

Parameters
resourceDependency:ResourceDependency — The dependency to be resolved.
resolveDependencyFailure()method 
arcane override function resolveDependencyFailure(resourceDependency:ResourceDependency):void

Resolve a dependency loading failure. Used by parser to eventually provide a default map

Parameters
resourceDependency:ResourceDependency — The dependency to be resolved.
supportsData()method 
public static function supportsData(data:*):Boolean

Tests whether a data block can be parsed by the parser.

Parameters
data:* — The data block to potentially be parsed.

Returns
Boolean — Whether or not the given data is supported.
supportsType()method 
public static function supportsType(extension:String):Boolean

Indicates whether or not a given file extension is supported by the parser.

Parameters
extension:String — The file extension of a potential file to be parsed.

Returns
Boolean — Whether or not the given file type is supported.
Wiki link
Click to go to the wiki page for 'away3d.loading.parsers.AWD1Parser'

Code examples

Comments