tags:

views:

39

answers:

1

I'm using Flashbuilder 4. I have a Spark TextInput control, and I'm implementing a "Copy" button that will copy the selected text only from within this control to the clipboard (pretty much like the RMB Copy does). How do I do this?

Thanks,

Paddy

A: 

Try this:

var beginIndex:int = Math.min(myTextInput.textDisplay.selectionActivePosition, myTextInput.textDisplay. selectionAnchorPosition);
var endIndex:int = Math.max(myTextInput.textDisplay.selectionActivePosition, myTextInput.textDisplay.   selectionAnchorPosition);
Sophistifunk
Worked a charm, thanks very much Sophistifunk.
Paddy