So my code is failing pretty hard. I’m trying to build a little tile editor for a game I’m about to make, but in setting up the tiles on the screen something goes wrong.
Here’s the code:
for (j = 0; j < _root.mapHeight; j++)
{
for (i = 0; i < _root.mapWidth; i++)
{
var newname:String = "tile" + i + "x" + j + "y";
var newTile:MovieClip = _root.attachMovie("mcTileInt", newname, _root.makeDepth);
newTile._x = (i * _root.tileWidth) + _root.editorOffsetX;
newTile._y = (j * _root.tileHeight) + _root.editorOffsetY;
trace(newTile);
_root.makeDepth += 1;
}
}
stop();
the trace just spits a whole bunch of 'undefined’s at me.
I double checked the variables once again just to be sure, and they’re all right.
Hope one of you can help me fix this
Solved, forgot exporting the movieclip for actionscript.