# Assign a Number value to a movieclip dynamically placed

**URL:** <https://forum.kirupa.com/t/assign-a-number-value-to-a-movieclip-dynamically-placed/312378>\
**Category:** flash\
**Created:** [August 1, 2010, 6:27pm UTC](https://forum.kirupa.com/t/assign-a-number-value-to-a-movieclip-dynamically-placed/312378 "2010-08-01T18:27:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccbass85](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@ccbass85](https://forum.kirupa.com/u/ccbass85)\
**Post date:** [August 1, 2010, 6:27pm UTC](https://forum.kirupa.com/t/assign-a-number-value-to-a-movieclip-dynamically-placed/312378/1 "2010-08-01T18:27:18Z")

</div>

Hey Guys,

I have a problem that should have a simple solution but I cant seem to figure it out. Basically I need to assign a movieclip a number value to that it will carry with it so I can later compare it to the number value of another movieclip.

Here is the snippet of my class code. I got a loop that creates a new object and adds it to the stage and then positions it. It all works accept for when I try to assign the i value to \_dragHead.HIT (HIT is not a movieclip nested within the \_dragHead object by the way). I just want each newly added movieclip to carry a unique number value so how would I achieve this?

```auto

private function createTerms():void
{
    for (var i:Number = 0; i < termsArr.length; i++)
    {	
     _dragHead = new DragAndDrop(); 
     addChild(_dragHead); 
     _dragHead.HIT = i;
     trace(_dragHead.HIT);
			
     _dragHead.x = termOrgX;
     _dragHead.y = termOrgY;
     _dragHead.setTerm(termsArr*)
			
     termOrgY += _dragHead.height + 15;
     }
}

```

Thanks in advance!
