setFocus() in InteractionManager is not working?
Hi,
I'm trying to implement TLF in out chat application and looks like setFocus() command in InteractionManager has a bug. Here is a code demonstrating it:
var tf:TextFlow = new TextFlow(); // define TextFlow and manager objects
var em:EditManager = new EditManager();
cc = new DisplayObjectContainerController(this, 290, 38);
tf.interactionManager = em;
// compose TextFlow to display
tf.flowComposer.addController(cc);
// add event handler to listen for SelectionEvent
tf.addEventListener(SelectionEvent.SELECTION_CHANGE, selectionHandler);
tf.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGED, graphicStatusChangeHandler);
tf.flowComposer.updateAllContainers(); // update visual representation
// format configuration
var charFormat:CharacterFormat = new CharacterFormat();
charFormat.color = me.colorsArray[me.currColor];
charFormat.fontFamily = "Tahoma, _sans";
charFormat.fontSize = 12;
charFormat.lineHeight = "80%";
tf.hostCharacterFormat = charFormat;
tf.interactionManager.setSelection(0,0);
var pf:ParagraphFormat = new ParagraphFormat();
pf.direction = Direction.RTL;
pf.marginLeft = 2;
pf.marginRight = 3;
pf.marginTop = 5;
IEditManager(tf.interactionManager).applyParagraphFormat(pf);
tf.interactionManager.setFocus();
Actually I see a cursor appears on screen but when I enter the text I am unable to see it. When I'll click with my mouse on the text edit area I can able to enter the text. Tell me what I'm doing wrong. May be the problem is only for text area which is set to RTL user input?
Looks like in the online rich text editor demo you have exactly the same problem, when you switch text direction from LTR to RTL you can't enter the text until you click with your mouse on the text edit area.
Igor Vasiliev
