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_DOWN, downHandler);
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?