It doesn't seem to be working.
In my function clickPiece I'm trying to get the object that is clicked to create a new "piece" where to keep the data of the clicked object so, when the second click is made, I could be able to make the swap between that 2nd object and 1st clicked object.
var piece:Piece = Piece(event.currentTarget);
Piece represents a movieclip from library and added dinamically. The Piece can be brown, red, pink, etc.