Run content of textField as actionscript!?

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:


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