# Re-using a MC while each retains their values (AS3)

**URL:** <https://forum.kirupa.com/t/re-using-a-mc-while-each-retains-their-values-as3/317041>\
**Category:** flash\
**Created:** [December 8, 2010, 7:39pm UTC](https://forum.kirupa.com/t/re-using-a-mc-while-each-retains-their-values-as3/317041 "2010-12-08T19:39:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MossyStump](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@MossyStump](https://forum.kirupa.com/u/MossyStump)\
**Post date:** [December 8, 2010, 7:39pm UTC](https://forum.kirupa.com/t/re-using-a-mc-while-each-retains-their-values-as3/317041/1 "2010-12-08T19:39:32Z")

</div>

Alright, so I would greatly appreciate any help others can give me! I’m attempting to re-use a single movieclip multiple times while each retains their individual values from the same class! I hope I made that clear =/ Anyway, Obviously adding the same movieclip over and over again wont work, as the next replaces the previous!  
The movieclip being placed exists in an array (sorta) the array is just a list of numbers, that when put through a loop changes the value of newPiece through a case to place the movieclip corresponding with the case and number from the array

```auto

package 
{

	import flash.display.MovieClip;
	import flash.display.Sprite;

	import flash.filters.*;
	import flash.geom.ColorTransform;
	import flash.geom.Transform;

	import flash.events.MouseEvent;
	import flash.events.Event;
	import flash.ui.Mouse;

	public class gameArea extends MovieClip
	{
		var gameGrid:MovieClip;
		var gameBar:MovieClip;

		var newPiece:MovieClip;

		var gridSprites:Array = new Array ;

		function gameArea()
		{
			addEventListener(Event.ADDED_TO_STAGE, createLevel);
			mirror.addEventListener(MouseEvent.CLICK, mirrorOnClick);

		}

		public function createLevel(e:Event)
		{
			var newPiece;
			gridSprites = Game(parent).currentLevel;
			for (var l:int = 0; 59>= l; l++)
			{
				switch (l)
				{
					case 0 :
						newPiece = new blank();
						break;
					case 1 :

						break;

				}
				addChild(newPiece);

				for (var j:int = 0; j <= 9; j++)
				{
					for (var i:int = 0; i <= 5; i++)
					{
						newPiece.x = j * 50 + 25;
						newPiece.y = i * 50 + 25;

					}
				}

			}

		}
		function mirrorOnClick(e:MouseEvent):void
		{
			trace("mirror1");

		}

	}

}

```
