# Buttons and xml

**URL:** <https://forum.kirupa.com/t/buttons-and-xml/145161>\
**Category:** Uncategorized\
**Created:** [April 20, 2005, 12:14pm UTC](https://forum.kirupa.com/t/buttons-and-xml/145161 "2005-04-20T12:14:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RabBell](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rabbell/32/340_2.png) [@RabBell](https://forum.kirupa.com/u/RabBell)\
**Post date:** [April 20, 2005, 12:14pm UTC](https://forum.kirupa.com/t/buttons-and-xml/145161/1 "2005-04-20T12:14:24Z")

</div>

ok, I’m following senoculars xml & flash tutorial and I’ve got a problem…

here is the code for the tricky section

> item\_mc.species\_txt.text = species.firstChild.nodeValue;  
> lparam = dept.firstChild.nodeValue;  
> item\_mc.main\_btn.location\_text = location.firstChild.nodeValue;  
> // set the onRelease of the item button to the DisplayInfo function  
> item\_mc.main\_btn.onRelease = DisplayInfo;

now I want to pass the value lparam to the DisplayInfo function because I’m trying to add links to each of the buttons. For instance each button will have a different url value that will come from the xml file.

at the moment the DisplayInfo is empty but it will look like this

> function DisplayInfo(pParam){  
> if (pParam == “EBAY”) { getURL(“[http://www.eBay.co.uk](http://www.eBay.co.uk)”); }   
> }

now if I change this line

item\_mc.main\_btn.onRelease = DisplayInfo;

to this

item\_mc.main\_btn.onRelease = DisplayInfo(lparam);

then DisplayInfo fires automatically without waiting for a mouse click and redirects me to the eBay site.

Any help is appreciated ☹
