2 Replies Latest reply on Apr 28, 2006 10:53 PM by Devendran

    setFocus Problem

    Devendran Level 1
      Hi all
      here with i have attahced the Code,

      Its working fine for Text to text,...

      But If new Focus is Combo box, its not working.

      My aim is to get last Focused element when i focused on combo

      Here is the simple code
        • 1. Re: setFocus Problem
          n_porkodi
          Hi,
          You can get only the current object to which the event occured using the "oldFocus" object.

          Try like this

          this.createTextField("input_txt",this.getNextHighestDepth(),100,100,100,20);
          input_txt.background = true;
          input_txt.border = true;
          input_txt.type = "input";
          var LastFocComponent bject = new Object();
          input_txt.onFocusOut = funtion(evtObj bject){
          LastFocComponent = evtObj.target;
          }
          //My old focus is not retrived here
          myCombo.onSetFocus = function(oldFocus bject){
          trace(oldFocus);
          trace(oldFocus._name);

          }
          • 2. Re: setFocus Problem
            Devendran Level 1
            Hello Porkodi,

            Which version of Flash You are using?

            No such a function "onFocusOut"

            Did u got the result Correclty?

            instead of this u have to use "onKillFocus" function

            onSetFocus will give u the OldFocus Name as a parameter,
            onKillFocus Will give u the NewFocus as a parameter.

            It is working fine for two combo component, and other component

            only problem is with InpuText and Combo, InputTextField and combo...