# Calling Function from String

**URL:** <https://forum.kirupa.com/t/calling-function-from-string/228936>\
**Category:** flash\
**Created:** [June 12, 2007, 7:32pm UTC](https://forum.kirupa.com/t/calling-function-from-string/228936 "2007-06-12T19:32:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![McGuffin](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mcguffin/32/408_2.png) [@McGuffin](https://forum.kirupa.com/u/McGuffin)\
**Post date:** [June 12, 2007, 7:32pm UTC](https://forum.kirupa.com/t/calling-function-from-string/228936/1 "2007-06-12T19:32:20Z")

</div>

Yeesh, no luck.

```auto

var classRef:Class = getDefinitionByName("fl.motion.easing."+eXML.type.@value) as Class;
var classInst:Object = new classRef();
trace(classInst, eXML.type.@value, eXML.func.@value); // outputs: [object Elastic] Elastic easeOut
var f:Function = classInst[[eXML.func.@value]()] as Function;
// error: TypeError: Error #1006: value is not a function.

```

classInst goes through fine (finds fl.motion.easing.Elastic and creates a new instance of that class). However, when I try to reference one of its methods, easeOut, using a string and targeting via the array method, it doesn’t work. Perhaps I’m missing a set of brackets somewhere?

Thanks very much for any help…
