# XML image into movieclips

**URL:** <https://forum.kirupa.com/t/xml-image-into-movieclips/314861>\
**Category:** flash\
**Created:** [October 11, 2010, 10:05am UTC](https://forum.kirupa.com/t/xml-image-into-movieclips/314861 "2010-10-11T10:05:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![burnzy](https://avatars.discourse-cdn.com/v4/letter/b/ecb155/32.png) [@burnzy](https://forum.kirupa.com/u/burnzy)\
**Post date:** [October 11, 2010, 10:05am UTC](https://forum.kirupa.com/t/xml-image-into-movieclips/314861/1 "2010-10-11T10:05:13Z")

</div>

I’m trying to get my xml images into movie clips on my stage.

Here is the AS im using to get them to come up onto the stage scrolling, but i want them to gointo movie clips i’ve created to for them.

I’ve serched the internet for ages, and i’ve tryed to use this forum search and all i get is a blank screen.

AS Code:

```auto

var xml:XML = new XML();

var img_count:uint;

var loader:URLLoader = new URLLoader();

var img_holder:Sprite=new Sprite();

var sw:Number=stage.stageWidth;

addChild(img_holder);

function xmlloaded(e:Event):void {
 
 xml=XML(e.target.data);
 
 img_count = xml.img.length()-1;
 
 for (var i:uint = 0; i<img_count; i++) {
  
  var thumb:Sprite=new createThumb(img_holder,String(xml.img*.@thumburl),String(xml.img*.@mainurl));
  thumb.x=105*i;
  
  img_holder.addChild(thumb);
 
 }

 stage.addEventListener(Event.ENTER_FRAME,mousescroll);

}

function mousescroll(e:Event):void {
 
 var ihw:Number = (img_holder.width-sw+100)*-1;
 var percent:Number = 50+(mouseX/sw)*(ihw);
 img_holder.x=percent;

}

loader.load(new URLRequest('gall.xml'));
loader.addEventListener(Event.COMPLETE,xmlloaded);

```

My xml file is:

```auto

<?xml version="1.0" encoding="utf-8"?>

<photographs>

<img mainurl="assets/sxc_hu_410471_5588.jpg" />

<img mainurl="assets/sxc_hu_1151936_79441078.jpg" />

<img mainurl="assets/sxc_hu_1154131_54136948.jpg" />

</photographs>

```

I’m new to flash / AS so all the help i can get is much appreciated.

Thanks for reading. :beer2:
