I've written a simple text editor using the textField. One feature is that the
user can select a word and make it a link. This pops up a Window component
with another textfield where they can enter the url. When the window is
closed, I update the main text field, and try to re-select the word like so:

                Selection.setFocus (tf);
                Selection.setSelection (beginIndex, endIndex);

This works, but then when I click somewhere else in the text field, the insert
caret appears where I clicked, but as soon as I let go, it jumps back to where
the code above set it. Only by clicking outside the window and back in can I
get the caret to move where I want.

I have read everything I can find on the web about flash's buggy textFields,
and have spend hours trying the semi-random work-arounds, to no avail.
I am using embeded fonts, which seem to cause extra problems, but I need
embeded fonts.
I also looked at using the using the TextArea component, but didn't see any way 
to
access the both the plain text and html text contents like you can with a 
textField.

Here's how I'm creating the textField:
                holder.createTextField("tf", table.child_depth++, 0, 0, 520, 
300);  
                this.tf = holder.tf;

                this.sb = UIScrollBar (holder.createClassObject( UIScrollBar,
                        "sb", table.child_depth++));
                this.sb.setScrollTarget(this.tf);

                this.sb._y = this.tf._y;
                this.tf.type = "input"; 
                this.tf.selectable = true;
                this.tf.multiline = true;       
                this.tf.wordWrap = true;
                this.tf.html = true;
                this.tf.embedFonts = true;
                this.tf.border = true;
                this.tf.borderColor = 0xa1a1a1;

Any suggestions or pointers?

-- 
Chris Bare
[EMAIL PROTECTED]
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to