0
votes

This probably has been answered.

Does anyone know how to add several TextInput Components in ActionScript in Adobe Flex 4.6? Ideally, I like this functionality to be in a function when at button is pressed.

I tried several examples that were posted but it would not render. For example:

protected function bTest_clickHandler(event:MouseEvent):void
{
   var tf:TextInput = new TextInput(); 
   var label:Label = new Label(); 
   var binding:ChangeWatcher = BindingUtils.bindProperty(label, "text", tf, "text"); 

   var hbox:HBox = new HBox(); 
   hbox.addChild(tf); 
   hbox.addChild(label); 
   addChild(hbox); 
}

Objective: Create several TextInput Components in a container without physical creating them in my mxlm body to make it appear it's a grid of m x n in various sizes of different instances.

Any suggestions?

2
Why not just use a List with a TileLayout or a GridLayout instead of reinventing the wheel? - RIAstar

2 Answers

0
votes

Set height/width or percentHeight/percentWidth on the label, textInput and hbox… or assign values for the text properties.

0
votes

var textInp:TextInput = new TextInput();

Agroup.addElement(textInp);