LOADING OBJECTS INSIDE MAIN CLASS

Software: Away3D 4.x

kz, Newbie
Posted: 06 December 2011 09:48 PM   Total Posts: 30

Hi, I have a question about the best pratice in preloading objects nested in external classes, I try to explain myself:

I have Main.as, in witch I have the scene, view, basic structures and functions etc..

I made some classes, each one extending ObjectContainer3d, and every class represent an experiment (meshes, sounds, etc..), and every mesh in the class is added to an empty cube called CONTAINER.

In my main class I want to add these experiments, and I need to add some mouseEvent3D to the container of each class.

So, for example:

var experimentClass1:Experiment1= new Experiment1();
scene.addChild(Experiment1);
Experiment1.CONTAINER.addEventListener(MouseEvent3D.MOUSE_DOWNdownHandler); 

My problem is that Experiment1.CONTAINER result null and throw an error (and I know it’s because is not fully loaded), but I can’t find the correct event listener to handle that (some addedToStage handler?)

I’m not sure you understand, if you do, do you have any hint on the pattern I should follow?

 

   

kz, Newbie
Posted: 07 December 2011 10:20 AM   Total Posts: 30   [ # 1 ]

Solved: http://www.flashcoder.net/blog/?p=100

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X