removeChild doesn't work in canvas
Hello I've been trying to adapt the following code with out success, can someone tell me where I'm going wrong? Need one button to add and another to remove:
var that = this;
this.buttonAdd.addEventListener("click", addFromLibrary);
this.buttonRemove.addEventListener("click", removeClip);
function addFromLibrary(e)
{
that.addChild(new lib.Rectangle());
}
function removeClip(e){
this.stage.removeChild(myRectangle);
}Thanks
