# \[AS2 OOP\] - Dynamic MCs or TextFields

**URL:** <https://forum.kirupa.com/t/as2-oop-dynamic-mcs-or-textfields/222514>\
**Category:** flash\
**Created:** [April 14, 2007, 3:23am UTC](https://forum.kirupa.com/t/as2-oop-dynamic-mcs-or-textfields/222514 "2007-04-14T03:23:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flash\_Test](https://avatars.discourse-cdn.com/v4/letter/f/848f3c/32.png) [@Flash\_Test](https://forum.kirupa.com/u/Flash_Test)\
**Post date:** [April 14, 2007, 3:23am UTC](https://forum.kirupa.com/t/as2-oop-dynamic-mcs-or-textfields/222514/1 "2007-04-14T03:23:38Z")

</div>

Hi,  
as you’ll see with the following snippet of code, I’m rather new to OOP for Flash.  
I’ve been trying to dynamically create a textField with no luck.

```auto

//mcPath:MovieClip is a parameter passed to the class' constructor
var myArray:Array = new Array("one", "two", "three");
for (var i=0; i>myArray.length; i++) {[INDENT]var eval("myMc_" + i):MovieClip = mcPath.createTextField("tempText" + i, mcPath.getNextHighestDepth(), 9, 30, 552, 0);
[/INDENT]}

```

The problem is that I get an error: (Syntax error)  
Any help would be very much appreciated. Thanks

ps. I did look around, but couldn’t find anything that could be of help to my problem. I’m sorry if this issue has already been dealt in the pass.
