xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark">
/* Import HBox class. */
import mx.containers.HBox;
/* Array of created containers. */
private var myHBoxes:Array = [];
public function addHBox():void {
/* Create new HBox container. */
var newHBox:HBox = new HBox();
newHBox.label="Label: " + String(myHBoxes.length);
/* Add it to the Accordion container, and to the
Array of HBox containers. */
myHBoxes.push(myAcc.addChild(newHBox));
}
public function delHBox():void {
/* If there is at least one HBox container in the Array,
remove it. */
if (myHBoxes.length>= 1) {
myAcc.removeChild(myHBoxes.pop());
}
}