Hey Dave
this is a problem we are aware of - a tip i have is to add your loader to
teh scene like this:
scene.addChild(loader.handle);
the handle property of the loader contains either the loader obejct itself,
or the loaded object (if the object loads instantaneously).
however, this doesn't fix the problem of a load success event being missed
because it is fired before the listener can be setup! There is actually a
mod in the latest updates that is designed to counter this and other issues
with the loading system in Away3d, and the basic premise is this:
loader = Max3DS.load("assets/f360.3ds");
loader.addOnSuccess(onSuccess);
scene.addChild(loader);
is now equal to
loader = new CubeLoader();
loader.addOnSuccess(onSuccess);
var max3DS:Max3DS = new Max3DS();
loader.loadGeometry("assets/f360.3ds", max3DS);
scene.addChild(loader);
this means you can be sure no object success event is missed. As an added
bonus, any properties for the loader and / or parser can be set on the
relevant instances using typechecked property setters - no more relying on
the init object. Should hopefully please the purists among you :)
These and other updates will be detailed in a full update email when
everything is ready for launch.
cheers
Rob
On Sun, Jul 26, 2009 at 9:17 AM, David Parks <[email protected]> wrote:
> Darn, I wish I had waited just a bit longer to post that, my very next
> effort revealed the problem (or at least I can reproduce it with a
> simplified example now).
>
>
>
> It appears (to my eyes) that if
>
> · I add the object to the scene AFTER it has finished loading, *only
> the cube loader is shown*.
>
> · If I add the object to the scene IMEDIATELY FOLLOWING the
> Obj.load() method, *it works fine*.
>
>
>
> Here’s what I did to reproduce it in a minimal test case, let me know what
> you think:
>
>
>
> 1) Call Obj.load()
>
> 2) Add onEnterFrame listener
>
> 3) Wait for the 300th frame before adding the object to the scene
>
>
>
> This displays the cube loader only. If I add the object to the scene on the
> first frame it works, same as if I add it immediately after creating it.
>
>
>
> Dave
>
>
>
>
>
>
>
> *From:* [email protected] [mailto:[email protected]] *On
> Behalf Of *Peter Kapelyan
> *Sent:* Sunday, July 26, 2009 2:52 PM
> *To:* [email protected]
> *Subject:* [away3d] Re: Intermittent error loading a mesh
>
>
>
> I've seen something similar with SWF's and plain ole' regular Flash. The
> SWF will load 100% but because it's cached (or something) one of the
> complete listeners never fires, usually in a certain browser (forget which
> one-maybe IE). Some questions:
>
> Does it happen just locally or or the web as well?
>
> Do you see the loading percentage, or does it just start at the final size?
>
> I forgot exactly what I did to fix the swf problem, but I remember once I
> had to change the =100% to = 99.99% (or something like that), and in another
> case I had to add another listener because a certain browser didn't like it.
> I don't know if it's the same error, butI have seen "something" like this
> before.
>
> -Pete
>
> On Sun, Jul 26, 2009 at 3:34 AM, David Parks <[email protected]>
> wrote:
>
> Ok, this is worth asking now.
>
>
>
> I am trying to use Obj.load(url). And I get an intermittent problem. Some
> times (vary rarely at the moment) the mesh will load just fine. Most times
> the cube loader will only ever display with the text “Loading Geometry…
> 51622 of 51622 bytes”.
>
>
>
> I’ve tried this with a couple of meshes generated by different apps.
>
>
>
> I haven’t been able to reproduce this in a simplified example (it loads
> fine in that attempt). So I have started stripping down a copy of my code to
> try to isolate the issue. But am not having much luck yet.
>
>
>
> So maybe it’s worth asking if anyone’s seen something like this before?
>
>
>
> Some potential oddities to note:
>
> · All I am loading is the .OBJ, no MTL file was generated (other
> than this issue that seems like a non issue). The .OBJ only contains the
> geometry, the texture map is a separate JPG that I will load once I get the
> mesh its self loading in a stable fashion.
>
> · I am adding the object to the scene in a separate step than when
> I create it (just happens to be the way the code flows), the loader object
> is being cast to an Object3D before being added to the scene.
>
>
>
> Thanks,
>
> David
>
>
>
>
>
>
> --
> ___________________
>
> Actionscript 3.0 Flash 3D Graphics Engine
>
> HTTP://AWAY3D.COM
>
--
Rob Bateman
Flash Development & Consultancy
[email protected]
www.infiniteturtles.co.uk
www.away3d.com