flex addChildAt()和removeChildAt ()
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"layout="vertical"verticalAlign="middle"backgroundColor="white"><mx:Script><![CDATA[import mx.core.*;import mx.controls.TextInput;import mx.containers.VBox;private var index:int=0;private function vbox_addChild():void {if (this.numChildren) {var texti:TextInput = new TextInput();vbox.addChildAt(texti,index);}}private function vbox_deleteChild():void {if (this.numChildren) {vbox.removeChildAt(this.index);}}]]></mx:Script><mx:ApplicationControlBar dock="true"><mx:Button label="+"click="vbox_addChild();" /><mx:Button label="-" click="vbox_deleteChild()" /><!--click="vbox_deleteChild();"--></mx:ApplicationControlBar><mx:VBox id="vbox" width="240" height="160" /></mx:Application>