# Item and linking

**URL:** <https://forum.kirupa.com/t/item-and-linking/142512>\
**Category:** Uncategorized\
**Created:** [March 29, 2005, 1:29pm UTC](https://forum.kirupa.com/t/item-and-linking/142512 "2005-03-29T13:29:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Macro\_design](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Macro\_design](https://forum.kirupa.com/u/Macro_design)\
**Post date:** [March 29, 2005, 1:29pm UTC](https://forum.kirupa.com/t/item-and-linking/142512/1 "2005-03-29T13:29:40Z")

</div>

I’m trying to create a little linking menu, for that I want to use items and then have some text within those items. When the user then clicks on the item, it’s supposed to link. It all has to be loaded externally from an xml file.

Now, I can get it to work half the way, the items come up, but it doesn’t load the text, and it doesn’t link either.

I would really appreciate it, if you guys could help me out here. (please let me know if fla is needed)

My AS:  
[AS]var item\_spacing = 50;  
var item\_count = 0;  
////////////////////////////  
function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild.firstChild.childNodes;  
header = [];  
link = [];  
////////////////////////////  
for (var i = 0; i\<xmlNode.length; i++) {  
header\* = xmlNode\*.childNodes[0].nodeValue;  
link\* = xmlNode\*.childNodes[1].nodeValue;  
////////////////////////////  
var item\_mc = menu\_mc.attachMovie(“menu\_item”, “item”+item\_count, item\_count);  
item\_mc.\_y = item\_count_item\_spacing;  
item\_count++;  
////////////////////////////  
item\_mc.rollOverItem.rollOverText.header\_txt.text = header.firstChild.nodeValue;  
item\_mc.main\_btn.onRelease = function() {  
getURL(link_, “\_blank”);  
};  
}  
} else {  
content = “file not loaded”;  
}  
}  
////////////////////////////  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“offentligeArrangementer\_arrangementer.xml”);[/AS]  
My XML:

```php
 <?xml version="1.0" ?>
<menu>
<menuitems>
<item type>
<header>Kirupa</header>
<link>http://www.kirupa.com/</link>
</item type>
...
</menuitems>
</menu>

```

Thanks, Morten
