1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| <?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.controls.TextInput;
public function init():void{
//create lot of components
var MAX:int = 10000;
for(var i:int=0;i<MAX;i++){
//create new textInput
var textInput:TextInput = new TextInput();
panel2.addElement(textInput);
}
}
]]>
</fx:Script>
<s:Panel id="panel">
<s:Panel id="panel2">
<s:layout>
<s:VerticalLayout/>
</s:layout>
</s:Panel>
</s:Panel>
<s:Button id="button" label="Create component" click="init()"/>
</s:Application> |