2 Replies Latest reply on May 14, 2008 6:12 PM by ntsiii

    Way to know what component is calling a function

    binkerboy Level 1
      Hi, all.

      I seem to remember seeing a way to know which component is calling a function. For example, lets say I have two datagrids, each with a similar list of components pulled from a database, but with different ComponentID's. One datagrid ID is dg1 and the other is dg2. I recall seeing a way to NOT have to hard code each dg ID in the function, but to recognize which component it calling the function. I feel it was something like "thisComponent" or "theComponent" or something like that.

      So, if I click on an item in either list, I call the function getComponentDetails().

      private function getComponentDetails():void {
      var setComponentID = thisComponent.selectedItem.ComponentID;

      ... now use this to get the data from the database and pass it to the handler ...
      }

      Anyone know what this was / is or someother way to do this.

      Thanks. Gary