# Turning a string into code

**URL:** <https://forum.kirupa.com/t/turning-a-string-into-code/300036>\
**Category:** flash\
**Created:** [November 14, 2009, 10:36pm UTC](https://forum.kirupa.com/t/turning-a-string-into-code/300036 "2009-11-14T22:36:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pokenerd](https://avatars.discourse-cdn.com/v4/letter/p/e9bcb4/32.png) [@Pokenerd](https://forum.kirupa.com/u/Pokenerd)\
**Post date:** [November 14, 2009, 10:36pm UTC](https://forum.kirupa.com/t/turning-a-string-into-code/300036/1 "2009-11-14T22:36:45Z")

</div>

Hi,

I’m trying to create a series of scripts that will create some custom event listeners.

I have three movie clips on my stage. One is a movieclip who’s sole function is to hold array’s and the event listeners. A second which moves around the screen. And a third that is motionless.

The problem is that the argument I want to test (which activates the custom event) is held within a string.

What I want to know is, how do you test to see if the string argument is true?

Is it something similar to this:

```auto
var myCode:String="1<0";

if(myCode){
	trace('one is smaller than 0'); //Strangely apparently one IS smaller than 0!!!
}

```

I think I’m going about this in the wrong manner, however this is the only way I can think of this working… (since I need to be able to dynamically create these events)

Thanks for any help,  
Pokenerd
