I want to add a button which when clicked adds another text field. I am using adobe flash builder to write the application therefore it needs to be in MXML or actionscript. Any ideas as to how this could be done?
The eventhandler button currently points to this code, however after the first addition of the textbox, it stops and doesn't add any more. How do I make a loop to keep adding textfields for every time the button is clicked?
<fx:Script>
<![CDATA[
protected function tableID(event:MouseEvent):void
{
var name:TextInput = new TextInput;
addElement(name);
name.move(50, 200);
}
]]>
</fx:Script>
MXML:
<s:Button id="addBtn" x="175" y="450" label="+" click="tableID(event)" />