Packageaway3d.loaders.parsers
Classpublic class MD2Parser
InheritanceMD2Parser Inheritance ParserBase Inheritance flash.events.EventDispatcher

MD2Parser provides a parser for the MD2 data type.



Public Properties
 PropertyDefined By
 InheriteddataFormat : String
[read-only] The data format of the file data to be parsed.
ParserBase
 InheriteddefaultBitmapData : BitmapData
[read-only] The url or id of the data or file to be parsed.
ParserBase
 Inheriteddependencies : Vector.<ResourceDependency>
[read-only] A list of dependencies that need to be loaded and resolved for the object being parsed.
ParserBase
  FPS : int = 6
[static]
MD2Parser
 InheritedparsingComplete : Boolean
[read-only]
ParserBase
 InheritedparsingFailure : Boolean
ParserBase
 InheritedparsingPaused : Boolean
[read-only]
ParserBase
Protected Properties
 PropertyDefined By
 Inherited_byteData : ByteArray
ParserBase
 Inherited_dataFormat : String
ParserBase
 Inherited_frameLimit : Number
ParserBase
 Inherited_lastFrameTime : Number
ParserBase
 Inherited_textData : String
ParserBase
Public Methods
 MethodDefined By
  
MD2Parser(textureType:String = jpg, ignoreTexturePath:Boolean = true)
Creates a new MD2Parser object.
MD2Parser
 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.
MD2Parser
  
supportsType(extension:String):Boolean
[static] Indicates whether or not a given file extension is supported by the parser.
MD2Parser
Protected Methods
 MethodDefined By
 Inherited
addDependency(id:String, req:URLRequest, retrieveAsRawData:Boolean = false, data:* = null):void
ParserBase
 Inherited
dieWithError(message:String = Unknown parsing error):void
ParserBase
 Inherited
finalizeAsset(asset:IAsset, name:String = null):void
ParserBase
 Inherited
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
 Inherited
onInterval(event:TimerEvent = null):void
Called when the parsing pause interval has passed and parsing can proceed.
ParserBase
 Inherited
ParserBase
  
proceedParsing():Boolean
[override] Parse the next block of data.
MD2Parser
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
Property Detail
FPSproperty
public static var FPS:int = 6

Constructor Detail
MD2Parser()Constructor
public function MD2Parser(textureType:String = jpg, ignoreTexturePath:Boolean = true)

Creates a new MD2Parser object.

Parameters
textureType:String (default = jpg) — The url or id of the data or file to be parsed.
 
ignoreTexturePath:Boolean (default = true) — The holder for extra contextual data that the parser might need.
Method Detail
proceedParsing()method
override protected 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 
override arcane 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 
override arcane 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.