I'm trying to load xml pictures into my cube surface and duplicate the cube. I've done the duplication on the cube, and still banging my head on the walls on the part to load pictures into the surface.
Code:private var materials:MaterialsList=new MaterialsList({ front:new MovieAssetMaterial("surFront",false,true), back:new MovieAssetMaterial("surBack",false,true), right:new MovieAssetMaterial("surRight",false,true), left:new MovieAssetMaterial("surLeft",false,true), top:new MovieAssetMaterial("surTop",false,true), bottom:new MovieAssetMaterial("surBottom",false,true)});Code:for (var i:Number=0; i < picList.length(); i++) { imageLoader=new Loader ; imageLoader.load(new URLRequest(picList[i].thumb)); imageLoader.x=25; imageLoader.y=i * 100 + 25; imageLoader.name=picList[i].largeimg; addChild(imageLoader); //currently the images and cube is load separately into the stage. how can i load the image into the surface "front" dynamically, then duplicate the cube? //---------------------------------------------------------------------------------------- cube=new Cube(materials,60,2,80,10,10,10); cubeArray.push(cube);//send cube into arrays cube.name="cube" + i;// set instance name cube.x=Math.random() * 950 - 460; cube.y=Math.random() * 700 - 330; cube.z=+5; cube.rotationZ=Math.random() * 360; scene.addChild(cube); } }




Reply With Quote