import mx.controls.CheckBox;
private var myCheckBox:CheckBox;
private var checkBoxDisplayed:Boolean = false;
public function addControlButton():void {
if(checkBoxDisplayed==false){
if (!myCheckBox) {
myCheckBox = new CheckBox();
}
myCheckBox.label = "New CheckBox";
myVBox.addChild(myCheckBox);
checkBoxDisplayed=true;
}
}
public function deleteControlButton():void {
if(checkBoxDisplayed){
myVBox.removeChild(myCheckBox);
checkBoxDisplayed=false;
}
}