# Reposition a movieclip on stage with coordinates from an xml

**URL:** <https://forum.kirupa.com/t/reposition-a-movieclip-on-stage-with-coordinates-from-an-xml/329227>\
**Category:** Uncategorized\
**Created:** [August 3, 2012, 8:55pm UTC](https://forum.kirupa.com/t/reposition-a-movieclip-on-stage-with-coordinates-from-an-xml/329227 "2012-08-03T20:55:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![4morrone](https://avatars.discourse-cdn.com/v4/letter/4/8baadc/32.png) [@4morrone](https://forum.kirupa.com/u/4morrone)\
**Post date:** [August 3, 2012, 8:55pm UTC](https://forum.kirupa.com/t/reposition-a-movieclip-on-stage-with-coordinates-from-an-xml/329227/1 "2012-08-03T20:55:49Z")

</div>

Hello i am new to this forum, and kinda a beginner with actionscript. what i’m trying to do is reposition a movieclip with the coordinates that will be in an XML file on my server. But so far no luck.

This is what i have for AS3

var my\_x:Number;  
var my\_y:Number;  
var myCoord:XML;

sample\_mc.x = my\_x;  
sample\_mc.y = my\_y;

var myXMLLoader:URLLoader = new URLLoader();  
myXMLLoader.load(new URLRequest(“coords.xml”));  
myXMLLoader.addEventListener(Event.COMPLETE, processXML);

function processXML (e:Event):void{  
var myXML:XML = new XML(e.target.data);  
myCoord = myXML.position.pos1;

```
my_x = myCoord.@XPOSITION;
my_y = myCoord.@YPOSITION;

```

}

And the XML file

\<position\>

\<pos1 XPOSITION=“100” YPOSITION=“55”\>  
\</pos1\>

\</position\>

let me know if anyone can help, please.
