# Flash 8: moving an mc with actionscript

**URL:** <https://forum.kirupa.com/t/flash-8-moving-an-mc-with-actionscript/234950>\
**Category:** flash\
**Created:** [August 7, 2007, 12:58pm UTC](https://forum.kirupa.com/t/flash-8-moving-an-mc-with-actionscript/234950 "2007-08-07T12:58:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![toast](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@toast](https://forum.kirupa.com/u/toast)\
**Post date:** [August 7, 2007, 12:58pm UTC](https://forum.kirupa.com/t/flash-8-moving-an-mc-with-actionscript/234950/1 "2007-08-07T12:58:55Z")

</div>

Hi,

I’m an art director trying to find my way through actionscript, so forgive me if this is an obvious question.

I have an mc calling in data from XML, but I would like to have the whole thing move across the screen like in a slide show. And then I would like to add buttons that for each image allowing me to click and go to that image.

## This is the code I have:

var xmlData:XML = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;

function loadXML(success:Boolean):Void  
{  
if (success)  
{  
var xmlPath:Array = xmlData.firstChild.childNodes;  
var xmlLength:Number = xmlData.firstChild.childNodes.length;

```
	for (var i:Number = 0; i &lt; xmlLength; i++)
	{
		var myMc:MovieClip = _root.attachMovie("holder_mc", "holder_mc" + i, i, {_x: (i * 126)});
		myMc.id = i;
					
		myMc.img_mc.loadMovie(xmlPath*.attributes.img);
		
		myMc.onRollOver = function():Void
		{
			trace(xmlPath[this.id].attributes.url);
		}
		
		myMc.onRelease = function():Void
		{
			getURL(xmlPath[this.id].attributes.url);
		}
	}
}
else
{
	trace("XML COULD NOT BE LOADED");
}

```

## } xmlData.load(“data.xml”);

Thanks
