# Interpreting String as function name ActionScript 3.0

**URL:** <https://forum.kirupa.com/t/interpreting-string-as-function-name-actionscript-3-0/244739>\
**Category:** flash\
**Created:** [November 21, 2007, 9:36am UTC](https://forum.kirupa.com/t/interpreting-string-as-function-name-actionscript-3-0/244739 "2007-11-21T09:36:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfsiddiq](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@mfsiddiq](https://forum.kirupa.com/u/mfsiddiq)\
**Post date:** [November 21, 2007, 9:36am UTC](https://forum.kirupa.com/t/interpreting-string-as-function-name-actionscript-3-0/244739/1 "2007-11-21T09:36:49Z")

</div>

Hi  
I want to know if there is any way a string can be interpreted as function name.I need this to call functions dynamically.Below is a code snippet which works fine if the function is in the same class as the function call.But what if i want to call a function present in another class or a different library.Any suggestions will be appreciated.

public var actionRef:String = “getit”

public function initApp():void  
{  
button.label=“Click”  
canvas.addChild(button);  
button.addEventListener(MouseEvent.CLICK,callMe);  
}

```
    public function callMe(event:MouseEvent):void
    {
        //if (this.hasOwnProperty(actionRef))
            this[actionRef]();
        
    }
     public function getit():void
    {
        trace("inside getit")
    }         

```

Cheers  
mfsiddiq
