Help with EditManager
Hello,
I am building a Spark-based TLF text editing component I'll be using in major application and I admit I am struggling.
It sure would be nice if Adobe was able to release the source code for the demo editors they have up on the Lab site, but I digress.
Anyway, I stumbled upon the EditManager and its capabilities today.
The way I am going about this is attaching a new EditManager instance to the textFlow.interactionManager property of a Spark TextArea control.
One thing I note when I do this is that the cursor doesn't appear in the TextArea with the above property set. That seems like it is a bug but it could be that the way I am going about trying to use an EditManager instance with the Spark TextArea is not best practice.
I am struggling to insert a link into the TextArea with the EditManager.applyLink method.
I am doing something like this:
var em:IEditManager = textArea.textFlow.interactionManager as IEditManager;
var stringLength:int = myString.length; // this is the length of the string that should show up as the title of the hyperlink
var startPos:int = textArea.selectionActivePosition; // this should be where the cursor currently is
em.insertText(myString); // this should insert the text at the location of the cursor in the TextArea - which it does
em.selectRange(startPos,startPos+stringLength); // this should select the word that was just added to the TextArea
em.applyLink(myURL); // this should transform the word I just added to a hyperlink
The above doesn't work. selectRange() isn't working, therefore applyLink obviously won't work.
Can someone help me get over this hurdle?
