import mx.controls.CheckBox;
import mx.controls.Alert;
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.addChildAt(myCheckBox, 0);
checkBoxDisplayed=true;
}
}
public function deleteControlButton():void {
if(checkBoxDisplayed){
myVBox.removeChild(myCheckBox);
checkBoxDisplayed=false;
}
}