You are calling a method on the class, not the instance of the class, calling addPiece()
from a static method where this
is not available at the current scope.
Add pieces to an instance of your slot machine game class:
var slotMachine:SlotMachine = new SlotMachine();
slotMachine.addPiece(0, 0, 1);
Otherwise if you call from a static method, this.addChild()
does not exist in the current context.