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 reorder():void {
if(checkBoxDisplayed==true){
if (myVBox.getChildIndex(myCheckBox) < myVBox.numChildren-1)
{
myVBox.setChildIndex(myCheckBox,
myVBox.getChildIndex(myCheckBox) + 1);
}
}
}