3 Replies Latest reply on Jan 29, 2013 8:27 AM by kglad

    tracing of input textField focus

    WarZebra6

      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

        • 1. Re: tracing of input textField focus
          kglad Adobe Community Professional & MVP

          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.

          • 2. Re: tracing of input textField focus
            WarZebra6 Level 1

            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

            • 3. Re: tracing of input textField focus
              kglad Adobe Community Professional & MVP

              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.