# Dynamically referencing objects

**URL:** https://forum.kirupa.com/t/dynamically-referencing-objects/292287
**Category:** flash
**Created:** [July 12, 2009, 11:27pm UTC](https://forum.kirupa.com/t/dynamically-referencing-objects/292287 "2009-07-12T23:27:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![chonchonchon](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chonchonchon](https://forum.kirupa.com/u/chonchonchon)
#### Post date: [July 12, 2009, 11:27pm UTC](https://forum.kirupa.com/t/dynamically-referencing-objects/292287/1 "2009-07-12T23:27:39Z")

</div>

Hi  
I was wondering if anyone could help me with this simple problem:

The problem is referencing object names dynamically in AS3, eg in a loop

Example  
I have an array called c4 which i would like to reference like this

I have a number  
var x:Number = 4

How can I do something like

trace([“c”+x].length);  
(i know this is wrong!)

Same with other objects  
eg. Movieclip called mc4

[“mc”+x].x = 100;

Thanks a lot for any help
