creationComplete="initApp()">
import mx.controls.Button;
private function initApp():void {
var b1:Button = new Button();
b1.addEventListener(MouseEvent.CLICK, removeButtons);
addChild(b1);
}
private function removeButtons(event:MouseEvent):void {
if (event.shiftKey) {
removeChild(Button(event.currentTarget));
} else {
event.currentTarget.toolTip = "hold shiftkey down and click to delete this button.";
}
}