AS2: Can I make a variable a function?

Hey guys–

I have a number of functions in my code that I want to be called from a List Component, depending on what the user selects from the list.

I’ve added a number of cities to the list like this:

combo.addItem({value:"akron",label:"Akron, OH."});
combo.addItem({value:"albany",label:"Albany, NY."});

where [COLOR=Blue]value[/COLOR] is a variable.

I’ve set up a listener for the List component that works fine and I can trace [COLOR=Blue]value [COLOR=Black]so I know things are working.

What I’d like to be able to do is, when the user selects the label “Akron, OH.”, the akron() function gets called.

I thought the way to do this was make a generic function called [COLOR=Blue]jumpTo(); [COLOR=Black]and then pass the name of the city to the function like this:


    combo.selectedItem.value = jumpTo;

I know intellectually this is dumb but I was just grasping at straws.

Any ideas?