0 Replies Latest reply on Feb 13, 2007 10:15 AM by Newsgroup_User

    Selection.setFocus problem

    Level 7
      Hi, I'm trying to set the focus on a textfield, but for some reason it
      doesn't seem to work...

      In the following script, _swf is a reference to the MovieClip that contains
      the textfield, and txtFldAr is an Array that contains all the textfield
      instance names:

      for (var i = 0; i<txtFldAr.length; i++) {
      _swf[txtFldAr ].text = "";
      _swf[txtFldAr
      ].type = "input";
      }
      _swf[txtFldAr[0]].text = "1";
      Selection.setFocus(_swf[txtFldAr[0]]);
      trace("Focus: "+Selection.getFocus());

      Setting the text to "1" works, only the getFocus returns 'null' ... why is
      that?

      Eric