How to update text or change text in TLF?
Hi,
I am unable to update the text within a TLF. This must be pretty basic, but am overlooking something.
This is the pseudo code:
pg_xml = new XML(str);
textFlow = TextConverter.importToFlow(pg_xml, TextConverter.TEXT_LAYOUT_FORMAT);
var tlf_sp = new Sprite();
textFlow.flowComposer.addController(new ContainerController(tlf_sp, width, height));
tlf_sp.x = posx;
tlf_sp.y = posy;
textFlow.flowComposer.updateAllControllers();
addChild(tlf_sp);
Elsewhere, the text needs to be updated:
pg_xml = new XML(str);
textFlow = TextConverter.importToFlow(pg_xml, TextConverter.TEXT_LAYOUT_FORMAT);
//TODO: figure out how to update text! updateAllControllers doesn't work.
//textFlow.flowComposer.compose(); //-- Didn't work.
//textFlow.flowComposer.updateAllContainers(); //-- Though this couldn't be used, I was just trying out, but didn't work either.
textFlow.flowComposer.updateAllControllers();
TLF version used: 4.0.0.13895
I just need to update the contents of a TLF rather than recreating a new textflow. Any help will be much appreciated.
Regards,
Shiyaz
