Skip to main content
Participant
March 15, 2013
Question

TLF multiline no wrap and text height problem

  • March 15, 2013
  • 1 reply
  • 998 views

When I set flow behaviour on "multiline no wrap" then I can't change height

for example put 2 TLF text field on scene - one with behaviour on "multiline" - second "multiline now wrap"

try this code

stage.addEventListener(MouseEvent.CLICK, resizeField);

var _height:int = 200;

txt1.wordWrap = true;

txt1.multiline = true;

txt1.border = true;

txt1.autoSize = TextFieldAutoSize.LEFT;

txt2.wordWrap = true;

txt2.multiline = true;

txt2.border = true;

txt2.autoSize = TextFieldAutoSize.LEFT;

function resizeField(e:MouseEvent):void

{

    _height = _height+100;

    txt1.height = _height;

    txt2.height = _height;

}

field with behaviour on "multiline" is resizing down

field with behaviour on "multiline now wrap" is not working - still have this same height - how can I change this dynamic in as code?

This topic has been closed for replies.

1 reply

Known Participant
March 15, 2013

instead of using script have you tried setting it in the properties box?

Participant
March 15, 2013

yes change from "multiline now wrap" to "multiline" is fixing problem, but this is not solution for dynamicly changing properties in AS, I have many templates in my application with this problem (upgrade from classic text) and this is some bug in TLF - solution is changing by code this - but how?