# Dynamically call function

**URL:** <https://forum.kirupa.com/t/dynamically-call-function/181204>\
**Category:** Uncategorized\
**Created:** [March 7, 2006, 10:52am UTC](https://forum.kirupa.com/t/dynamically-call-function/181204 "2006-03-07T10:52:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThePuzzleMaster](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thepuzzlemaster/32/972_2.png) [@ThePuzzleMaster](https://forum.kirupa.com/u/ThePuzzleMaster)\
**Post date:** [March 7, 2006, 10:52am UTC](https://forum.kirupa.com/t/dynamically-call-function/181204/1 "2006-03-07T10:52:59Z")

</div>

I’ve got an array of strings, and I want when each movie clip with the same name is pressed, to call a function of the same name. But I can’t get it to work. I’ve tried quite a few different ways, but nothing is working.

Anyone know how to do this?

Here’s the last one I tried…

```auto

linksArray = new Array("gabe", "vesna", "hel", "sam", "walt", "kirupa");
trace(linksArray);
for (var i = 0; i<linksArray.length; i++) {
    var temp = this[linksArray*];
    temp.id = i;
    temp.onRelease = linksArray[this.id];

}
gabe = function () {
    trace("pressed");
    getURL("www.gabrielmathews.com");
};
gabeInfo = function () {
    trace("info");
};

```
