# Adding a movieclip from the stage into an array?

**URL:** <https://forum.kirupa.com/t/adding-a-movieclip-from-the-stage-into-an-array/287859>\
**Category:** flash\
**Created:** [May 7, 2009, 3:13am UTC](https://forum.kirupa.com/t/adding-a-movieclip-from-the-stage-into-an-array/287859 "2009-05-07T03:13:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vathian](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@Vathian](https://forum.kirupa.com/u/Vathian)\
**Post date:** [May 7, 2009, 3:13am UTC](https://forum.kirupa.com/t/adding-a-movieclip-from-the-stage-into-an-array/287859/1 "2009-05-07T03:13:37Z")

</div>

Hello and good day to you!

I am attempting to push an object into an array based on its instance name on the stage…how do I do this?

On my stage I’ve simply made a box, turned it into a movie clip named “mcBox” and have given it an instance name of “box\_mc” on the stage. Here is my current test code:

```auto
var energy:Number = 0.75;
var boxArray:Array = new Array;

box_mc.addEventListener(MouseEvent.CLICK, onClick);
function onClick(e:MouseEvent):void
{
	if(energy >= 0.5)
	{
		boxArray.push(box_mc);
	}
	
	trace(boxArray);
}

```

Since the default amount of energy satisfies the if statement I push the movieClip into the array and then trace it. In my output I receive “[object MovieClip]”…is there anyway to distinguish it by its instance name?

What am I doing wrong?
