How to I set the position of the caret when entering or clicking in a
non-empty TextField.

I've tried:-

var field1:TextField;
var field2:TextField;

function onSetFocus():Void {
        trace(this+" b="+Selection.getCaretIndex());
        Selection.setSelection(0,0);
        trace(this+" a="+Selection.getCaretIndex());
}

field1.onSetFocus = onSetFocus;
field2.onSetFocus = onSetFocus;

but it isn't working as expected. When I tab into a field, the whole
content is selected the caret index is -1 before and after I change
the position. When I click in the field, the caret stays at the
position clicked and the caret index is 0 before and after I change
the position.

What am I doing wrong?

Chris
--
Chris Velevitch
Manager - Sydney Flash Platform Developers Group
m: 0415 469 095
www.flashdev.org.au
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to