If I am creating say a input field through MXML
, I can set the width to 100%
. But I cannot seem to do this at runtime through ActionScript.
This works:
<mx:TextInput ... width="100%" />
This wont compile, says width is a number, not a string:
var textinp:TextInput = new TextInput();
someContainer.addChild(textinp);
textinp.width = "100%"
How can I set 100%
as the size on a component created at runtime via ActionScript?