I am using Flash CS5 and ActionScript 3.
I need to dynamically (in response to an event) flip the wordWrap property of a TLFTextField from true to false and vice versa. I had it working with the old TextField class, but I I can't get it to work with TLF.
I declare my field and set it up like so, with wordWrap set to true:
this.field = new TLFTextField;
field.multiline = true;
field.wordWrap = true;
field.autoSize = TextFieldAutoSize.LEFT;
field.tlfMarkup = my_content;
this.addChild(field);
var myTextFlow:TextFlow = field.textFlow;
myTextFlow.hostFormat = format; //format is a TextLayoutFormat declared earlier
myTextFlow.flowComposer.updateAllControllers();
To change the word wrapping, I've tried the following:
field.wordWrap = false;
field.multiline = false;
var myTextFlow:TextFlow = field.textFlow;
myTextFlow.flowComposer.updateAllControllers();
But this has no effect - the text stays wrapped. Can anyone tell me what I'm missing?
Thanks in advance,
Amanda