01-16-2011 06:30 AM
I am attempting to create a label from the information given in a TextInput box and need it to autoSize to the length of the text. The api describes the property for this that I am following but get the following error:
1120: Access of undefined property TextFieldAutoSize. MyIdeasBoard.as /MyIdeasBoard/s
The code for this is as follows:
var tempString:String = newTextInput.text; var thisTextField:Label = new Label(); thisTextField.text = tempString; thisTextField.autoSize = TextFieldAutoSize.RIGHT;
Grateful for any assistance
Solved! Go to Solution.
01-16-2011 07:03 AM
My experience is that you don't need to specify the width of a Label, it'll make it fit automatically. Just set the text, remove the autoSize line and add it.
01-16-2011 08:50 AM
from the looks of it everything looks fine. i am able to use the autoSize properly on my machine. what it sounds like is you are importing the wrong Label class. make sure you are importing the qnx.ui.text.Label class. hope that helps. good luck!