# Loading xml elements with dinamyc x/y

**URL:** <https://forum.kirupa.com/t/loading-xml-elements-with-dinamyc-x-y/249126>\
**Category:** Uncategorized\
**Created:** [January 15, 2008, 5:44pm UTC](https://forum.kirupa.com/t/loading-xml-elements-with-dinamyc-x-y/249126 "2008-01-15T17:44:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pablosci](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/pablosci/32/1321_2.png) [@pablosci](https://forum.kirupa.com/u/pablosci)\
**Post date:** [January 15, 2008, 5:44pm UTC](https://forum.kirupa.com/t/loading-xml-elements-with-dinamyc-x-y/249126/1 "2008-01-15T17:44:50Z")

</div>

hey there  
im having a big trouble  
i cant resolve this script  
i took this from a fla sample

> menuXml = new XML();  
> menuXml.ignoreWhite = true;  
> menuXml.onLoad = function(success) {  
> if (success) {  
> var menuItem = menuXml.firstChild.childNodes;  
> for (var i = 0; i\<menuItem.length; i++) {  
> Nombre = menuItem\*.firstChild.nodeValue;  
> Link = menuItem\*.attributes.url;  
> attachMovie(“item\_mc”, “item\_mc”+i, i);  
> \_root[“item\_mc”+i].\_x = 110_i;  
> \_root[“item\_mc”+i].\_y = 0_i;  
> \_root[“item\_mc”+i].etiqueta\_txt.text = Nombre;  
> \_root[“item\_mc”+i].Link = Link;  
> \_root[“item\_mc”+i].Rectangulo\_btn.onRelease=function(){  
> getURL(this.\_parent.Link); }  
> }  
> }  
> };  
> menuXml.load(“menu.xml”);

this load a xml file, with text and a url

> \_root[“item\_mc”+i].\_x = 110_i;  
> \_root[“item\_mc”+i].\_y = 0_i;

this part gives a y position to the loaded element  
but, this is a standard distance between all the elements  
i need that the \_y position will be according / next to the last element, not always with the same distance  
any clue?

thanks
