# \[Flash 8 AtnScpt\] Squirrel Finder Example

**URL:** https://forum.kirupa.com/t/flash-8-atnscpt-squirrel-finder-example/228358
**Category:** flash
**Created:** [June 7, 2007, 4:52am UTC](https://forum.kirupa.com/t/flash-8-atnscpt-squirrel-finder-example/228358 "2007-06-07T04:52:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![discoitdown](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@discoitdown](https://forum.kirupa.com/u/discoitdown)
#### Post date: [June 7, 2007, 4:52am UTC](https://forum.kirupa.com/t/flash-8-atnscpt-squirrel-finder-example/228358/1 "2007-06-07T04:52:08Z")

</div>

Hi, I am going through the squirrel tutorial in the XML intro. I want to assign a different action/link to each dynamically created button. How do i access each of the buttons do to so? Is this possible? Here is the example of code from the tutorial. Its a basic loop that goes through an xml file and creates a menu from the information there. I appreciate your help, thanks!  
[SIZE=1]  
[/SIZE]function CreateMenu(menu\_xml){  
var items = menu\_xml.firstChild.firstChild.childNodes;  
for (var i=0; i\<items.length; i++) {  
if (items\*.attributes.type == “squirrel”) {  
var species = items\*.firstChild;  
var location = items\*.childNodes[1];

var item\_mc = menu\_mc.attachMovie(“menu\_item”,“item”+item\_count, item\_count);  
item\_mc.\_y = item\_count \* item\_spacing;item\_count++;  
item\_mc.species\_txt.text = species.firstChild.nodeValue;  
item\_mc.main\_btn.location\_text = location.firstChild.nodeValue;  
item\_mc.main\_btn.onRelease = DisplayInfo;  
}  
}  
}
