Dynamic .onRelease / GetUrl Technique

Hello all -

I’m kind of new to Flash, I took the ActionScript for programmers class from Macromedia so I’m not a total noob ;))

Nonetheless I’m a bit stuck. I’m not sure if I can do the following. If this will take a lot of time to explaine maybe someone could point me at some key words, or key concepts.

Background:
[font=Tahoma]Instead of having to write a “.onRelease / getURL” for every button on the map, I tried to put the instance names of all the symbol/buttons in an array and loop over that array to create the “.onRelease / getURL” dynamicly.[/font]
[font=Tahoma][/font]
[font=Tahoma]Code:[/font]
[font=Tahoma][font=Arial][size=2]// this is the array of symbol/button instance names that have been created in the movie[/size][/font]
[font=Arial][size=2][color=#0000ff]var StateArray = new Array(“Vorarlberg_btn”,“Tirol_btn”,“Salzburg_btn”,“Tirol2_btn”,“Oberosterrich_btn”,“Karnten_btn”,“Steiermark_btn”,“Niederosterreich_btn”,“Wien_btn”,“Burgenland_btn”);[/color][/size][/font]
[font=Arial][size=2][color=#0000ff]
[/color][/size][/font][font=Arial][size=2][color=#0000ff][color=#000000]// this is the section I am unsure of, can this be done??[/color]
[/color][/size][/font][font=Arial][size=2][color=#0000ff]/*
for (var i=1; i <= StateArray.length; i++)
{
StateArray*.onRelease = function() {
getURL(“javascript:ListInfo(‘Austria’,”+"’"+StateArray*+"’)");
};
}
*/[/color][/size][/font]
[font=Arial][size=2][color=#0000ff][/color][/size][/font]
//Original code to prove concept of sending data to bowser via js or URL load.
[font=Arial][size=2][color=#0000ff][font=Tahoma][size=2][color=#000000]// used to make URL string easy to use[/color][/size][/font]
[font=Arial][size=2]var baseURL = “[color=#0000ff]http://localhost/RincEx/Mapping/MapTest/index.cfm?FUSEACTION=ShowResult[/color]”;[/size][/font]
[font=Arial][size=2][/size][/font]
[font=Arial][size=2]var baseCountry = “Austria”;[/size][/font]
[/color][/size][/font]
[font=Arial][size=2][color=#0000ff][/color][/size][/font]
[font=Arial][size=2]// if I hard code the instance name of the symbol/buttons, it works fine. (Also, I comment these out to test the block above.)[/size][/font]
[font=Arial][size=2][color=#0000ff]Tirol2_btn.onRelease = function() {
getURL(“javascript:ListInfo(‘Austria’,”+"‘Tirol2’)");
};[/color][/size][/font]
[font=Arial][size=2][color=#0000ff][/color][/size][/font]
[font=Arial][size=2]// this works fine also, again hard coded instance name (Also, I comment these out to test the block above.)[/size][/font]
[font=Arial][size=2][color=#0000ff]Tirol_btn.onRelease = function() {
getURL(baseURL + “&COUNTRY=Austria&STATE=Tirol”, “RESULT_FRAME”);
};[/color][/size][/font]
[/font]