# Run content of textField as actionscript!?

**URL:** <https://forum.kirupa.com/t/run-content-of-textfield-as-actionscript/274066>\
**Category:** Uncategorized\
**Created:** [October 24, 2008, 1:13pm UTC](https://forum.kirupa.com/t/run-content-of-textfield-as-actionscript/274066 "2008-10-24T13:13:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![artheus](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@artheus](https://forum.kirupa.com/u/artheus)\
**Post date:** [October 24, 2008, 1:13pm UTC](https://forum.kirupa.com/t/run-content-of-textfield-as-actionscript/274066/1 "2008-10-24T13:13:49Z")

</div>

Hey!

What I want to do is running the content of a textField, which the user can change, as ActionScript that affects the movie in any way.

Example:

The user writes:

```auto

var imageURLRequest:URLRequest = new URLRequest(http://www.somedomain.com/somepicture.jpg); 
var myImageLoader:Loader = new Loader();
 
myImageLoader.load(imageURLRequest);
 
myImageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded); 
 
function imageLoaded(e:Event) {
    var iSprite:Sprite = new Sprite(e.target.content);
    addChild(iSprite);
 
    iSprite.x = 20;
    iSprite.y = 400;
}

```

In a textField, and then push a button with the label “execute”. And the flash will run the text in the textField as ActionScript, and load the picture (don’t mind if the code in the textbox above isn’t correct though).

So… is there a function or something that would be able to do this??

Cheers,  
Artheus
