0
votes

Flex's mx.controls.TextInput default width is documented as:

The size of the text with a default minimum size of 22 pixels high and 160 pixels wide

Is there a way to change the initial width? 160 pixels is too wide for my application. If I specify an absolute width (width="100"), then it doesn't scale as parent container width changes. If I specify width="100%", it scales to the parent container, but still defaults to 160. There is measuredWidth, but it gets set by measure(). I could extend TextInput and override measure(), but I'd rather just use TextInput as is.

I'm using Flex 4.1.

2

2 Answers

0
votes

Set stage.scaleMode=StageScaleMode.NO_SCALE and minWidth should work because interface elements won't scale so your text field will keep its width.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Stage.html#scaleMode

0
votes

Why don't you use constraint-based parameters such as left & right, instead of x and width. For example:

<mx:TextInput left="5" right="5" />