i'm not sure what you're trying to do but textfield's have onSetFocus() and onKillFocus() methods that allow you to detect what text, if any, is selected and the text property of the textfield.
Yes it seems that onSetFocus() and onKillFocus() will be my answer. I want achieve that I have some of texts and under each texts is background which should highlight according which text is focused.
My first idea make it by something like :
if (tfText1._focus == 1)
But onSetFocus() and onKillFocus() is even better for my purphose to I dont need to have a lot of "if's" : )
you can control the background of a textfield but you can't control the background of individual characters populating a textfield.
there are ways to work around that but none of them are convenient. for example, you can distribute each character to its own textfield, assign backgrounds to the various textfields and position the textfields so it appears to be text in one textfield.