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
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");
}
}
}