# Assigning actionscript to Dynamic Buttons

**URL:** <https://forum.kirupa.com/t/assigning-actionscript-to-dynamic-buttons/205027>\
**Category:** flash\
**Created:** [October 25, 2006, 2:26pm UTC](https://forum.kirupa.com/t/assigning-actionscript-to-dynamic-buttons/205027 "2006-10-25T14:26:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nioute](https://avatars.discourse-cdn.com/v4/letter/n/9e8a1a/32.png) [@nioute](https://forum.kirupa.com/u/nioute)\
**Post date:** [October 25, 2006, 2:26pm UTC](https://forum.kirupa.com/t/assigning-actionscript-to-dynamic-buttons/205027/1 "2006-10-25T14:26:33Z")

</div>

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](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.
