Hi there, I'm using an array to create a level. When I use numbers in this array, such as in the code below:
Actionscript Code:
if(lvlArray[i] == 1){
            //mcCastleWall
            var newPlacement1:mcCastleWall = new mcCastleWall();
            CastleWallHolder.addChild(newPlacement1);
        }
everything works fine. However, when I use letters, such as in the code below:
Actionscript Code:
} else if (lvlArray[i] == u){
            //mcCastleExit
            var newPlacementu:mcCastleExit = new mcCastleExit();
            CastleExitHolder.addChild(newPlacementu);
        }
I get the error '1120: Access of undefined property k.'
What's wrong with using letters? Or, if not letters, the code?
If it helps, it says the error is in line 193, which refers to this section of code:
Actionscript Code:
} else if (lvlArray[i] == u){