Error on container of containers!!

Software: Away3D 4.x

charlito, Jr. Member
Posted: 28 March 2012 09:02 AM   Total Posts: 36

Hi.. I been working on a simple proyect so i could traing myself into away3d..

but i have seen something weird.. i dont know if its a bug or i m doing it wrong.

i have this containers:

public var contenedor_c1:ObjectContainer3D = new ObjectContainer3D();
public var 
contenedor_c2:ObjectContainer3D = new ObjectContainer3D();
public var 
contenedor_c3:ObjectContainer3D = new ObjectContainer3D();
public var 
contenedor_c4:ObjectContainer3D = new ObjectContainer3D();
public var 
contenedor_c5:ObjectContainer3D = new ObjectContainer3D();
public var 
contenedor_c6:ObjectContainer3D = new ObjectContainer3D();
public var 
contenedor_c7:ObjectContainer3D = new ObjectContainer3D();
public var 
contenedor_c8:ObjectContainer3D = new ObjectContainer3D();

//and then i have this other containers

public var cont_Top:ObjectContainer3D = new ObjectContainer3D();
public var 
cont_Front :ObjectContainer3D = new ObjectContainer3D();
public var 
cont_Back :ObjectContainer3D = new ObjectContainer3D();
public var 
cont_Bottom :ObjectContainer3D = new ObjectContainer3D();
public var 
cont_Left :ObjectContainer3D = new ObjectContainer3D();
public var 
cont_Right :ObjectContainer3D = new ObjectContainer3D(); 


then in another function i have

cont_Front.addChild(contenedor_c1);
cont_Front.addChild(contenedor_c2);
cont_Front.addChild(contenedor_c3);  //line 150;
cont_Front.addChild(contenedor_c4);
view.scene.addChild(cont_Front);
   
cont_Back.addChild(contenedor_c5);
cont_Back.addChild(contenedor_c6);
cont_Back.addChild(contenedor_c7);
cont_Back.addChild(contenedor_c8);
view.scene.addChild(cont_Back);
      
cont_Bottom.addChild(contenedor_c3); //line 160
cont_Bottom.addChild(contenedor_c4);
cont_Bottom.addChild(contenedor_c7);
cont_Bottom.addChild(contenedor_c8);
view.scene.addChild(cont_Bottom); 

and the problem beggins when i add to diferent containers the same container (in this case, container name=contenedor_c3)
like in lines 150 and 160.
i cant rotate or move or anything.. their become unmovable and i cant rotate them either.

this code also gets me a wrong result

var arrayFront:Array = new Array();
arrayFront.push(contenedor_c1);
arrayFront.push(contenedor_c2);
arrayFront.push(contenedor_c3);
arrayFront.push(contenedor_c4);
trace("arrayFront = "+arrayFront);
//trace output = c1_azul,c2_azul,c3_azul,c4_azul,[object ObjectContainer3D],[object ObjectContainer3D],[object ObjectContainer3D],[object ObjectContainer3D]

trace("arrayFront #elements= "+arrayFront.length);
//trace output= arrayFront #elements = 8 

.

am i doing it wrong??  is it a bug?? or it just the way it works??
this just doesnt make sence to me…


Thx alot.. for all ur advices, tips, and/or answares.

Ur friend Charlie.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X