I am creating a platform game through the use of arrays, and i am inserting the platforms in a variable called blockHolder. I have successfully inserted generated blocks, but i want to insert my own movieclip, so i replaced this code:
Before:
else if (lvlArray* == 1)
{//making a new block
var newBlock2:Block = new Block ;
//drawing the block
newBlock2.graphics.beginFill(0x000000,1);
//turning the shape into a square;
newBlock2.graphics.drawRect(0,0,25,25);
//change the coordinates of the block;
newBlock2.x = (i - (colunas - 1) * lvlColumns) * newBlock2.width;
newBlock2.y = (colunas - 1) * newBlock2.height;
//then finally adding it to stage
blockHolder.addChild(newBlock);
}
For this code:
if (lvlArray* == 1)
{
//making a new block
newBlock = new platNev ;
//then finally adding it to stage
blockHolder.addChild(platNev);
}
And it gives the error: Implit coercion of a value of type class to an unrelated type flash etc. Any ideias?