Hi All, How to create dynamic label and button in flex 3?
A:
public function yourFunction():void
{
var tmpLbl:Label = new Label();
tmpLbl.x = 10;
tmpLbl.y = 5;
tmpLbl.text = "Label Text";
yourObj.addChild(tmpLbl); // where yourObj is the object you want to add the label to
}
Pretty much the same deal for a button except the buttons text would be set with btn.Label
To add an onclick event just use
btn.addEventListener(MouseEvent.CLICK, ...
Chris Klepeis
2009-06-29 06:28:16
Thanks Chris.i got the solution.
aravindakumarThangaraju
2009-07-15 09:23:02