Loader3D: Loading multiple models at once causes AIR 3 to crash in debug mode

Software: Away3D 4.x

Jason Latta, Newbie
Posted: 05 September 2011 06:49 PM   Total Posts: 16

My guess is I am doing something wrong. When I load 3 .3ds files at the same time it will crash out in AIR in debug mode but work fine when I publish normally. I am building the project in Flash Builder 4.5.

Here is what I am doing now:

var par:Max3DSParser = new Max3DSParser();
var 
loader:Loader3D = new Loader3D();
ramp = new ObjectContainer3D();
loader.addEventListener(LoaderEvent.RESOURCE_COMPLETE, function(e:LoaderEvent):void
{
 
var mesh:Mesh Mesh(ramp.getChildAt(0));
 
mesh.material dots
 mesh
.subMeshes[0].scaleU 3;
 
mesh.subMeshes[0].scaleV 15;
 
mesh.position = new Vector3D(0,-0,-100);
 
trace("Ramp Loaded")
 
slingShotLoader.load(new URLRequest("assets/game/slingArm.3DS"),slingShotPar);
 
});
loader.load(new URLRequest("assets/game/ramp.3DS"),par);
ramp loader;

var 
slingShotPar:Max3DSParser = new Max3DSParser();
var 
slingShotLoader:Loader3D = new Loader3D();
slingShot = new ObjectContainer3D();
slingShotLoader.addEventListener(LoaderEvent.RESOURCE_COMPLETE, function(e:LoaderEvent):void
{
 
var mesh:Mesh Mesh(slingShot.getChildAt(0));
 
mesh.material.lights [light1light2light3];
 
// load sling after sling handle is loaded, loading at same time caused debugger to crash
 
slingLoader.load(new URLRequest("assets/game/slingCup.3DS"),slingPar);
});
slingShot slingShotLoader;

var 
slingPar:Max3DSParser = new Max3DSParser();
var 
slingLoader:Loader3D = new Loader3D();
sling = new ObjectContainer3D();
slingLoader.addEventListener(LoaderEvent.RESOURCE_COMPLETE, function(e:LoaderEvent):void
{
 
var mesh:Mesh Mesh(sling.getChildAt(0));
 
mesh.material.lights [light1light2light3];
 
mesh.rotationY 180;
 
});
sling slingLoader

So to fix it I am daisy-chaining the load of each file’s RESOURCE_COMPLETE.

Am I doing this wrong? Should I be merging this all into one Loader3D?

 

   

Avatar
Alejandro Santander, Administrator
Posted: 05 September 2011 11:05 PM   Total Posts: 414   [ # 1 ]

Can you show us what error you are getting?

   

Jason Latta, Newbie
Posted: 05 September 2011 11:25 PM   Total Posts: 16   [ # 2 ]

I don’t get an error. The app window fades white and a windows pop says this app has stopped responding with a button to check for solution…which is worthless.

I am running
windows 7 (64-bit) home premium.
Flash Builder 4.5
Air 3 beta (latest from labs)

So should I not be having that issue? and should I be able to have multiple Loader3D load calls going at the same time? Like I said it works normally but just not when I do the debug option from Flash Builder.

I have 10 more models to load and I guess I am going to daisy-chain them unless there is a better way.

   

Avatar
Choons, Sr. Member
Posted: 06 September 2011 12:21 AM   Total Posts: 281   [ # 3 ]

you probably should use the Asset Library approach to loading all that. It’s much cleaner and less likely to have conflicting load calls with that many assets

   

Jason Latta, Newbie
Posted: 06 September 2011 12:23 AM   Total Posts: 16   [ # 4 ]

Ok I will give that a shot.

   

Avatar
Alejandro Santander, Administrator
Posted: 06 September 2011 12:31 AM   Total Posts: 414   [ # 5 ]

I have no idea what’s going on. It would help if you could profile or debug the situation so we can find where exactly the code is failing.

   

Jason Latta, Newbie
Posted: 06 September 2011 02:04 AM   Total Posts: 16   [ # 6 ]

And there is the problem… I get no debug output in flash builder. The AIR app freezes right away and crashes. There is no output, it doesn’t even get to that point!  I will try to recreate it again and attach the project.

   

Jason Latta, Newbie
Posted: 06 September 2011 02:11 AM   Total Posts: 16   [ # 7 ]

And now I can’t recreate it. Who knows. I will let you know if it happens again.

   

Avatar
Alejandro Santander, Administrator
Posted: 07 September 2011 12:48 AM   Total Posts: 414   [ # 8 ]

K, if you do, please try to abstract the problem to the simplest situation you can, then we can have a look at the code.

   
   
‹‹ I don’t get it.

X

Away3D Forum

Member Login

Username

Password

Remember_me



X