class not communicating with document class
I created classes that would hold the layout of my level. So level 1 has an array like:
floor1[0] = [2,1,1,1,1,1,2];
floor1[1] = [1,1,1,1,1,1,1];
floor1[2] = [1,1,1,2,1,1,1];
floor1[3] = [1,1,1,1,1,1,1];
floor1[4] = [1,1,1,2,1,1,1];
floor1[5] = [1,1,1,1,1,1,1];
floor1[6] = [2,1,1,1,1,1,2];
And level 2 would contain a different setup like:
floor2[0] = [1,1,1,3,1,1,1];
floor2[1] = [1,2,1,3,1,2,1];
floor2[2] = [1,1,1,3,1,1,1];
floor2[3] = [1,1,1,2,1,1,1];
floor2[4] = [1,1,1,3,1,1,1];
floor2[5] = [1,2,1,3,1,2,1];
floor2[6] = [1,1,1,3,1,1,1];
Here's my problem. These classes aren't communicating with my document class. My document has a blank array called createFloor that will equal floor1 first. Once that level is finished, it will equal floor2, and so on. The code is below:
for (var Y:int=0; Y<createFloor.length; Y++)
{
for (var X:int=0; X<createFloor
{
var cell:MovieClip = new Tile(X,Y);
cell.gotoAndStop(createFloor
cell.x = ((X-Y)*tileh)+365;
cell.y = ((X+Y)*tileh/2)+70;
addChild(cell);
cell.addEventListener(MouseEvent.CLICK, mouseclick);
cell.addEventListener(Event.ENTER_FRAME, onGame);
}
}
I'm not sure how to get the document class and the level class to talk to each other. I tried making the level class extend the Main, but I fugre that had nothing to do with it. Any ideas
