Hey Phenom
the static Collada.parse() method automatically create a Loader3D object and
sets it parsing in one go. with objects that require no additional loading,
this is done in a single line of code, hence your listener is being set the
line after the success event has fired.
to allow the inline return of the parsed away3d object from an object
parser, you can use the more recent notation now allowed:
collada = new Collada();
view.scene.addChild(collada.parse(file.content));
or if your collada file contains textures that require loading, you can do
the following:
loader = new Loader3D();
loader.addOnSuccess(parsedone);
view.scene.addChild(loader);
collada = new Collada();
loader.parseGeometry(file.content, collada);
hth!
Rob
On Tue, Oct 13, 2009 at 9:21 PM, Fabrice3D <[email protected]> wrote:
>
> may be because you set the event after the parse method...
> if its a small object and you test locally, it often happends that parsing
> is done before the eventListenner is set.
> thats also one of the reasons we have updated the loader3D class.
>
> to access from the "parsedone"
>
> private function parsedone(e:Loader3DEvent):void
> {
> object3d = e.loader.handle; --> object3D: can be
> Mesh or ObjectContainer3D
>
>
> Fabrice
>
>
>
> On Oct 13, 2009, at 9:54 PM, martin wrote:
>
>
>> nobody has a solution...
>>
>> On 12 Okt., 19:03, martin <[email protected]> wrote:
>>
>>> hello @all,
>>> here, thePhenom decribe my problem too:
>>> http://groups.google.com/group/away3d-dev/browse_thread/thread/2ee9ba...
>>>
>>> i parse my collada file with the parser loader because i generate the
>>> collada-data dynamic.
>>> how can i create events to control the success of the loading!?
>>> i try this but it not working:
>>> var loader:Loader3D;
>>> loader = Collada.parse(file.content, {scaling:30,
>>> material:texture}) as Loader3D;
>>> loader.addOnSuccess(parsedone);
>>> view.scene.addChild(loader);
>>> the event doesn't trigger...
>>> rob u mean i should "cast the returned ObjectContainer3D to
>>> Object3DLoader and
>>> proceed as normal". how should i cast that i can use the parse loader
>>> like a load loader?
>>> thx
>>> martin
>>>
>>
>
--
Rob Bateman
Flash Development & Consultancy
[email protected]
www.infiniteturtles.co.uk
www.away3d.com