# Flash CS3 AS2 - Convert String to Function name

**URL:** <https://forum.kirupa.com/t/flash-cs3-as2-convert-string-to-function-name/272056>\
**Category:** flash\
**Created:** [October 1, 2008, 5:30pm UTC](https://forum.kirupa.com/t/flash-cs3-as2-convert-string-to-function-name/272056 "2008-10-01T17:30:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joseg](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@joseg](https://forum.kirupa.com/u/joseg)\
**Post date:** [October 1, 2008, 5:30pm UTC](https://forum.kirupa.com/t/flash-cs3-as2-convert-string-to-function-name/272056/1 "2008-10-01T17:30:08Z")

</div>

I am using AS 2 in Flash CS3 and XML. I have the function named in the XML file which I would like to be called via a rotating banner. However I can’t seem to convert the string (read via the XML file) to convert to the function name.

a trace reveals that the correct string is being called:  
\_parent.\_parent.\_parent.loadFunction.

urls[count] is the array that stores the function name.

Here is the script:  
button.onRelease = function(){

```
    this[urls[count]]();

trace(urls[count]);

}

```

I have tried as many variations as I can including:  
this[urls[count]]; (with the () as part of the XML string)  
this[“urls”+count];  
this.\_parent.\_parent.\_parenturls[count];

When the correct string is placed within the onRelease function, it works as expected. But using the “this[]” to convert the string to a function name is not working for me.  
What am I missing??

Any help would be greatly, greatly appreciated.

Thanks in advance.
