Buttons and xml

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”); }
}

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 :frowning: