Packagesandy.parser
Classpublic final class Parser

The Parser factory class creates instances of parser classes. The specific parser can be specified in the create method's second parameter.


Example
To parse a 3DS file at runtime:
      var parser:IParser = Parser.create( "/path/to/my/3dsfile.3ds", Parser.3DS );
  



Public Methods
 MethodDefined by
  
create(p_sFile:*, p_sParserType:String = null, p_nScale:Number = 1):IParser
[static] The create method chooses which parser to use.
Parser
Events
 EventSummaryDefined by
   Dispatched when parsing fails.Parser
   Dispatched when parsing is complete.Parser
   Dispatched when the file starts loading.Parser
   Dispatched when a parser reads the next line of data in a file.Parser
   Dispatched when data is received as the parsing progresses.Parser
Public Constants
 ConstantDefined by
  ASE : String = "ASE"
[static] Specifies that the ASE (ASCII Scene Export) parser should be used.
Parser
  COLLADA : String = "DAE"
[static] Specifies that the COLLADA (COLLAborative Design Activity ) parser should be used.
Parser
  MAX_3DS : String = "3DS"
[static] Specifies that the 3DS (3D Studio) parser should be used.
Parser
Method detail
create()method
public static function create(p_sFile:*, p_sParserType:String = null, p_nScale:Number = 1):IParser

The create method chooses which parser to use. This can be done automatically by looking at the file extension or by passing the parser type String as the second parameter.

Parameters
p_sFile:* — Can be either a string pointing to the location of the file or an instance of an embedded file
 
p_sParserType:String (default = null) — The parser type string
 
p_nScale:Number (default = 1) — The scale factor

Returns
IParser — The parser to be used

Example
To parse a 3DS file at runtime:
       var parser:IParser = Parser.create( "/path/to/my/3dsfile.3ds", Parser.3DS );
   

Event detail
onFailEVENTevent 
Event object type: sandy.parser.ParserEvent

Dispatched when parsing fails.

onInitEVENTevent  
Event object type: sandy.parser.ParserEvent

Dispatched when parsing is complete.

onLoadEVENTevent  
Event object type: sandy.parser.ParserEvent

Dispatched when the file starts loading.

onParsingEVENTevent  
Event object type: sandy.parser.ParserEvent

Dispatched when a parser reads the next line of data in a file.

onProgressEVENTevent  
Event object type: sandy.parser.ParserEvent

Dispatched when data is received as the parsing progresses.

Constant detail
ASEconstant
public static const ASE:String = "ASE"

Specifies that the ASE (ASCII Scene Export) parser should be used.

COLLADAconstant 
public static const COLLADA:String = "DAE"

Specifies that the COLLADA (COLLAborative Design Activity ) parser should be used.

MAX_3DSconstant 
public static const MAX_3DS:String = "3DS"

Specifies that the 3DS (3D Studio) parser should be used.