Collada.parse how to use onSuccess in combination

4 views
Skip to first unread message

thePhenom

unread,
Dec 1, 2008, 7:44:48 AM12/1/08
to away3d.dev
Hi

Could anyone post on how to use onSuccess in combination of
Collada.parse. I am aware that you can use it in combination of
Collada.load function

Thanks

Li

unread,
Dec 1, 2008, 8:25:39 AM12/1/08
to away3...@googlegroups.com
Mmm...

Your making a good point here.

Collada.load() returns an Object3DLoader to which you can attach event listeners. Collada.parse() returns an ObjectContainer3D instead, a casted ObjectContainer3D. Been trying to listen for progress and complete events for this with no luck also.

Anyone else? Is there a way to do this with the current revision or do we need a little update in order to properly trace:

1) Collada.load() - Progress and succes events on both loading and parsing.
2) Collada.parse() - Progress and success events on parsing.

I am just suggesting an update, shouldnt be too diffcult. I could be wrong of course, perhaps using these methods incorrectly, there being a way to do this already.

=/

Rob Bateman

unread,
Dec 8, 2008, 7:04:13 PM12/8/08
to away3...@googlegroups.com
Hey ThePhenom

sorry to have kept you waiting on this one - had a busy week gone!

essentially the type of object the parse method returns depends on what you are doing with the parser. If you have instructed it to autoload textures (something that will be done automatically on collada and 3ds files, the parse method will return an Object3DLoader object. Similarly, if you have specified the chunk timeout value to be small on the collada loader (this is the minimum time value allows for parsing a file in any particular frame event), the parse function will return an Object3DLoader object. If neither of these are the case, the parse method will return an object pertaining to the type of the parser - collada and 3ds will always return an ObjectContainer3D. The reason why the return value is cast this way is that Object3DLoader extends ObjectContainer3D. So if you have either of the above scenarios and want to track progress using onProgress or onSuccess listeners, you can cast the returned ObjectContainer3D to Object3DLoader and proceed as normal.

hope that makes sense!

Rob
--
Rob Bateman
Flash Development & Consultancy

rob.b...@gmail.com
www.infiniteturtles.co.uk
www.away3d.com
Reply all
Reply to author
Forward
0 new messages