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 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
Example
To parse a 3DS file at runtime:
var parser:IParser = Parser.create( "/path/to/my/3dsfile.3ds", Parser.3DS );
Event object type: sandy.parser.ParserEvent
Dispatched when parsing fails.
Event object type: sandy.parser.ParserEvent
Dispatched when parsing is complete.
Event object type: sandy.parser.ParserEvent
Dispatched when the file starts loading.
Event object type: sandy.parser.ParserEvent
Dispatched when a parser reads the next line of data in a file.
Event object type: sandy.parser.ParserEvent
Dispatched when data is received as the parsing progresses.
public static const ASE:String = "ASE"
Specifies that the ASE (ASCII Scene Export) parser should be used.
public static const COLLADA:String = "DAE"
Specifies that the COLLADA (COLLAborative Design Activity ) parser should be used.
public static const MAX_3DS:String = "3DS"
Specifies that the 3DS (3D Studio) parser should be used.
Sandy 3.0 Documentation