Txtfield Selection pb!

Hello,

What i’m trying to do is trace the selection of a txtfield using a button… I started like that :


this.btbold.onPress = function() {
	mylt = new Object();
	Selection.addListener(mylt);
	Selection.setFocus(_root.mytf);

My pb is, i have to set focus 1st on the txtfield, as the flash help says, but my selection becomes the whole txtfield… I only want ot be able to trace my current selection… How should i do?? TiA :thumb:

probably use
Selection.getBeginIndex();
Selection.getEndIndex();
and then use a substring function or something to get the text.

–EP

The real problem is that once that the button is pressed you’ll lose focus on the text field; therefore, the selection will be lost. :stuck_out_tongue:

I’d probably try something like this, see attachment. :wink:

Yep exactly what i needed, you rock !! Thanks a bunch !! :p: