# Calling functions dynamicallyyy

**URL:** https://forum.kirupa.com/t/calling-functions-dynamicallyyy/32943
**Category:** Uncategorized
**Created:** [October 13, 2003, 3:27pm UTC](https://forum.kirupa.com/t/calling-functions-dynamicallyyy/32943 "2003-10-13T15:27:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kupreg](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kupreg/32/171_2.png) [@kupreg](https://forum.kirupa.com/u/kupreg)
#### Post date: [October 13, 2003, 3:27pm UTC](https://forum.kirupa.com/t/calling-functions-dynamicallyyy/32943/1 "2003-10-13T15:27:11Z")

</div>

hmmm. i’m trying to call a function on a clip, but i want to use a variable that i’m sending to the clip so that when the one function gets done it knows what to do next. i just have no idea of what the syntax would be. here’s a sample.

MovieClip.prototype.moveHere=function(x,y,spd,func){  
this.\_x+=(x-this.\_x)/spd;  
this.\_y+=(y-this.\_y)/spd;  
if(Math.abs(this.\_x-x)\<1 && Math.abs(this.\_y-y)\<1){  
this.\_x=x;  
this.\_y=y;  
trace(“done” add func);  
if(func!=null){  
//the function i want to call is  
this.menu();  
//but i want to use the variable func  
//i think i need to use ['s but i have no idea the exact use. is it something like this below?  
this[func add “()”];  
}  
this.onEnterFrame=null;  
}  
}

danke
