0 Replies Latest reply on May 5, 2006 9:11 AM by B.Freelance

    tabIndex & setFocus issues.

    B.Freelance
      Hi all,

      I am having a real issue with getting tabIndex and setFocus to work with my custom TextInput component. I have tried everything that I can possibly think of and it just won't work. When I test the component and set tabIndex or setFocus nothing happens. Any ideas would be greatly appreciated. Below is the actionscript I have in my class file. (note: need it to work for fp 7+)

      class brownfreelance.components.AdvTextInput extends MovieClip {

      private var _mTextContainer:MovieClip;
      private var _tTextBox:TextField;
      private var _bTabChildren:Boolean;
      private var _nTabIndex:Number;

      public function setFocus():Void {
      Selection.setFocus(_mTextContainer._tTextBox);
      }

      public function set tabIndex(nTabIndex:Number):Void {
      _mTextContainer._tTextBox.tabIndex = nTabIndex;
      }

      public function AdvTextInput() {
      CreateTextBox();
      _mTextContainer._tTextBox.tabChildren = true;
      _mTextContainer._tTextBox.tabEnabled = true;
      _mTextContainer._tTextBox.tabIndex = _nTabIndex;
      }

      private function CreateTextBox():Void {
      _mTextContainer.clear();
      _mTextContainer = createEmptyMovieClip("_mTextContainer", getNextHighestDepth());
      _mTextContainer.createTextField("_tTextBox", getNextHighestDepth(), 2, 2, (_nWidth-2), (_nHeight-1));
      }

      }

      Thank's in advance.