I got a 8x8 grid, filled with random movie clips from 7 frames (they got no. 1 to 7).
What am I trying to do (from last 3 days) ?
When clicked on any movie clip get their neighbor movie clip type and if they are same disappear.
This is taken from the first row.
3 2 1 7 2 6 6 6
here If i click the third clip which is 1, check both side compare it with current one and if it is not same do nothing else disappear.
Here is the code i have done so far
public function clickPiece(e:Event)
{
var currPiece:String;
var match:Array;
currPiece = e.currentTarget.type
trace(currPiece);
//trace(grid[0][0].type);
for(var i:int=1; i<8; i++){
//trace(grid*[0].type);
if (currPiece == grid*[0].type) {
match.push(grid*[0]);
trace (match.length);
}
}
}
this code gives me error
can anyone tell me what shall i do from hereā¦ i am stuck