Skip to main content
Energetic_Captain154A
Inspiring
January 28, 2013
Answered

tracing of input textField focus

  • January 28, 2013
  • 1 reply
  • 630 views

Hello,

I was lookig for this topic but nowhere was clear explanation. Is there a way to trace for focus on text input by some really easy way and not over the listener?

Thanks

Wz

This topic has been closed for replies.
Correct answer kglad

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.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
January 28, 2013

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.

Energetic_Captain154A
Inspiring
January 29, 2013

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)

{

     MovieClip.gotoAndPlay("on");

}

But onSetFocus() and onKillFocus() is even better for my purphose to I dont need to have a lot of "if's" : )

Thanks

kglad
Community Expert
Community Expert
January 29, 2013

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.