Loader3DEvent error

Software: Away3D 4.x

orkman, Newbie
Posted: 17 October 2012 06:08 AM   Total Posts: 9

Getting a 1046: Type not found or was not a compile-time constant: Loader3DEvent error.

I import the away3d.events.Loader3DEvent

And my functions are:

function loadModel():void
{
var loader3D:Loader3D = Collada.load(“daeModel/stock.dae”);
loader3D.addEventListener(Loader3DEvent.LOAD_SUCCESS, onModelLoadSuccess);
}

function onModelLoadSuccess(event:Loader3DEvent):void
{
cow = event.loader.handle as ObjectContainer3D;
cow.scale(5);
cow.moveDown(1);
view.scene.addChild(cow);
}

But it does not like the (event:Loader3DEvent) line.

Any thoughts? Thanks.

I just upgraded to Flash CS6 with AIR 3.4. Thanks.

   

Avatar
Darcey, Moderator
Posted: 17 October 2012 04:25 PM   Total Posts: 209   [ # 1 ]

This might help:
http://www.allforthecode.co.uk/aftc/forum/user/modules/forum/article_browser.php?index=8&subindex=8&clist=222

Embedded and Preloaded versions are there.

Loader3D.loadData(): for the preloded version I use the string which is retrieved via the LoaderMax API.

var text:String preloader.getContent("model"

Loader3D.loadData(): for embedded would use new ClassName()

You should also take a look at:
http://markmail.org/download.xqy?id=ts3i6hsnusqsrnb6&number=1

and

http://away3d.com/forum/viewthread/2665/

D

   

orkman, Newbie
Posted: 18 October 2012 06:10 AM   Total Posts: 9   [ # 2 ]

Thanks Darcy, I got a 3DS file to work based on one of your links.

Only issue is the model is loading behind all of my 2D elements and layers in Flash. Is there a way to make the model appear on the topmost layer? Thanks!

   

Avatar
Darcey, Moderator
Posted: 18 October 2012 09:58 AM   Total Posts: 209   [ # 3 ]

Sadly flash’s display list has become somewhat restrictive when using Stage3D and StageVideo. The display list goes something like this:

1. Stage Video
2. Stage 3D
3. Stage 2D

and it cannot be moved! I too also think this was a really dumb move by adobe.

The only work arounds I know of are:

1. (I’ve not tried this): Scan the Stage3D into BitmapData via BitmapData.draw() method and place in Stage 2D. (Will probably remove all the speed benefits of using Stage 3D (Away3D 4.x))

2. Use Away3D 3.x which is in the Stage 2D (Good bye sweet GPU and hello low frame rates).

3. Move your Stage 2D elements to Stage 3D planes. Create planeGemetry’s and textures for your 2D elements and add them to the Away3D 4 view.

Good luck

D

   

orkman, Newbie
Posted: 18 October 2012 03:40 PM   Total Posts: 9   [ # 4 ]

Ok thanks, I actually punched a hole in my background image in 2D so the 3D can show and it looks great.

My question is, am I asking for trouble in starting to code all the little 2D buttons and such that appear over stage3d? Will the code simply not run, or will it just be too heavy a load on the processor?

I guess I will find out!

   

orkman, Newbie
Posted: 18 October 2012 06:22 PM   Total Posts: 9   [ # 5 ]

I just went ahead and did it. I am publishing to AIR 3.4 for iOS. It works great. I have my normal 2D GUI. And then I load in a .3ds file and set the x, y, width and height to fit in a specific area of the app. It all works great! Thanks for all the help.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X