Copy link to clipboard
Copied
I'm gonna start with an example:
var testTF:TextField = new TextField();
var testTA:TextArea = new TextArea();
var testSpr:Sprite = new Sprite();
testSpr.addChild(testTF);
testSpr.addChild(testTA);
testTA.width = 400;
testTA.x = 200;
trace(testSpr.width);
Now, the trace seems like it should spit out 600, right? For whatever reason though it's only spitting out the width as though testTF were the only thing in there. It's not just trace statements that are being weird either, this is making it difficult to dynamically position things to the right of testSpr. Is there something weird about how TextAreas and TestInputs behave as children of another display object? If it makes any difference, this is part of an AIR 2.0 project. Thanks.
apply the validateNow() method to your textarea before querying size:
.
.
.
testTA.validateNow();
trace(testSpr.width)
Copy link to clipboard
Copied
apply the validateNow() method to your textarea before querying size:
.
.
.
testTA.validateNow();
trace(testSpr.width)
Copy link to clipboard
Copied
Works perfect now! Thanks.
Copy link to clipboard
Copied
you're welcome.