# Referencing MovieClips made from the UI

**URL:** <https://forum.kirupa.com/t/referencing-movieclips-made-from-the-ui/295198>\
**Category:** Uncategorized\
**Created:** [August 26, 2009, 3:06pm UTC](https://forum.kirupa.com/t/referencing-movieclips-made-from-the-ui/295198 "2009-08-26T15:06:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeancnicolas](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jeancnicolas](https://forum.kirupa.com/u/jeancnicolas)\
**Post date:** [August 26, 2009, 3:06pm UTC](https://forum.kirupa.com/t/referencing-movieclips-made-from-the-ui/295198/1 "2009-08-26T15:06:34Z")

</div>

Hi there,  
I have 23 movieclips on Stage. Each one is a class of ‘point’, and has been given an instance name of p1, p2, p3, p4 etc.

I want to reference them in code, and then get their x and y co-ords eventually.

How do I make them accessible variables in AS3? in AS2 I would have put them into a for loop, and said

```auto
for(i=0,i<23;i++)
{
trace(_root["p"+i])
}

```

so in AS3

```auto
var p:String;
for(var i:uint = 0;i<23;i++)
{
    var currentClip:MovieClip;
    currentClip = point['p'+i];
    trace(currentClip.x)
}

```

hmm, im just not sure man! any help would be ace!:rock:
