# XML loading image to 1side of cube + looping cube

**URL:** <https://forum.kirupa.com/t/xml-loading-image-to-1side-of-cube-looping-cube/258750>\
**Category:** flash\
**Created:** [April 27, 2008, 9:45pm UTC](https://forum.kirupa.com/t/xml-loading-image-to-1side-of-cube-looping-cube/258750 "2008-04-27T21:45:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![youwh](https://avatars.discourse-cdn.com/v4/letter/y/82dd89/32.png) [@youwh](https://forum.kirupa.com/u/youwh)\
**Post date:** [April 27, 2008, 9:45pm UTC](https://forum.kirupa.com/t/xml-loading-image-to-1side-of-cube-looping-cube/258750/1 "2008-04-27T21:45:49Z")

</div>

I’m currently stuck on loading image through xml into a surface of a cube. The cube have 6 surface with different MC. I wanted to load in image to one of the MC, and duplicate the cube according to the amount of image in the XML file.

```auto
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)});

```

```auto
for (var i:Number=0; i < picList.length(); i++) {
                imageLoader=new Loader ;
                imageLoader.load(new URLRequest(picList*.thumb));
                imageLoader.x=25;
                imageLoader.y=i * 100 + 25;
                imageLoader.name=picList*.largeimg;
                addChild(imageLoader);

                //----------------------------------------------------------------------------------------

                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);
            }

```

Currently the picture is loaded into the stage. How could I assign it to load a image into the surface “front”, then only duplicate the cube, with different front image each cube?

---

<div class="post-metadata">

**Author:** ![youwh](https://avatars.discourse-cdn.com/v4/letter/y/82dd89/32.png) [@youwh](https://forum.kirupa.com/u/youwh)\
**Post date:** [May 9, 2008, 9:25am UTC](https://forum.kirupa.com/t/xml-loading-image-to-1side-of-cube-looping-cube/258750/2 "2008-05-09T09:25:27Z")

</div>

anyone?
