Assigning actionscript to Dynamic Buttons

Hi all,

I was trying to modify a particular function found here on Kirupa, in a tutroial called Squirrel Finder:

http://www.kirupa.com/web/xml/examples/squirrelfinder.htm

I basically want to know how I can assign an incremental value to a [COLOR=“Red”]loadAlbum[/COLOR] command which is then assigned to each dynamically generated button. So what I’ve got is the original function:

[COLOR=“Red”]function DisplayInfo(){
menu_mc._visible = false;
infobox_mc._visible = true;
infobox_mc.content_txt.text = this.location_text;
}
[/COLOR]

I need to replace both [COLOR=“Red”]_visible[/COLOR] commands with this command: [COLOR=“Red”]**eventssp.loadAlbum(); **[/COLOR]
Where I reach a dead end is the [COLOR=“Red”]loadAlbum();[/COLOR] number which I need to somehow increase numerically, [COLOR=“Red”]eventssp.loadAlbum(1, 2, 3…);[/COLOR] so that each button calls a different number.

What would be the simplest way to do this? any help appreciated,

Thanks

Richard.