1 Reply Latest reply on May 30, 2007 10:04 PM by boxdoctor

    Quickie getFocus() Question...

      Ok, I'm slamming my head up against the wall on this one. Have a class function where it needs to know what object actually called it, and because its a 3rd party component I can't pass the object into the function.

      I'm just trying to get the simple ID of the object (like txtMyTextBox or cbMyComboBox, etc.) through getFocus, but I'm getting the long root (Myapp0.pnlTest.txtPrime.TextInput144), or just the name (UITextInput12). Here's an example:

      private function Setup():void
      var io:InteractiveObject = getFocus();
      trace("All: " + io.toString()) // returns MyApp0.txtTest.TextInput144.UITextInput12
      trace("Name: " + io.name) // returns UITextInput12
      trace("Parent: " + io.parent) // returns the big one like MyApp0.txtTest.TextInput144

      I just want "txtTest". Any ideas???!!!???

        • 1. Re: Quickie getFocus() Question...
          boxdoctor Level 1
          Ok, just a thought on this...if there's no way to get the actual ID for the currently focused object, is there some sort of "global" function that I can write that will continually allow me to have access to the ID of the last or currently selected object? Just a thought. Any ideas greatly welcomed.