External links in picture gallery/slideshow

I worked through the picture gallery and slideshow tutorials, and even added external links to the images using XML. However, I want to link the caption as well, or add a button that links to a different page for each image. I created a button named textlink and added the links in the XML and included this code in my fla file:

textlink.onRelease = function() {
getURL(link[p]);

but, it didn’t work. On hover, the button shows that it is clickable, but nothing happens when clicked. Any ideas on what I might have done wrong?

Thanks in advance,
joshmcdan