# Creating different MovieClip Instances while Looping?

**URL:** <https://forum.kirupa.com/t/creating-different-movieclip-instances-while-looping/268793>\
**Category:** Uncategorized\
**Created:** [August 18, 2008, 9:25pm UTC](https://forum.kirupa.com/t/creating-different-movieclip-instances-while-looping/268793 "2008-08-18T21:25:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaptankorkut](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@kaptankorkut](https://forum.kirupa.com/u/kaptankorkut)\
**Post date:** [August 18, 2008, 9:25pm UTC](https://forum.kirupa.com/t/creating-different-movieclip-instances-while-looping/268793/1 "2008-08-18T21:25:01Z")

</div>

Hi,

I’m getting the last 5 rows from a database with AMFPHP engine. The results are parsed into an array of an array (rows and their column values)

I am using a for statement to deliver all the results from the Array. For each loop I want to create an instance of a movieClip from my Lybrary “Title”. But I can’t assign the “i” as an instance variable name.

The code looks like that:

```auto

// parse the ArrayCollection
var t:Array = responds.serverInfo.initialData;
for(var i:uint=0; i<t.length; i++)
{
  //crate new instance of title and name it the "id" value
  var t*[0]:Title = new Title;
  addChild(title*[0]);
  t*[0].x = 25;
  t*[0].y += 35;
  //Set the "title" column value as text
  t*[0].dynamicText.text = t*[1];
  t*[0].buttonMode = true;
  t*[0].addEventListener(MouseEvent.CLICK, showDetail); 
}    

```

I am getting the error: 1086: Syntax error: expecting semicolon before leftbracket.

I tried “var i:Title”, dosen’t function as well, the error was:  
1151: A conflict exists with definition i in namespace internal.

I should somehow numerate those movie clips and add to the stage.

Thanks in advance
