title: Get Button click position on indexOf array from a component
body: <p>Thank you in advance,
  I'm trying get the position of a button on the array after the button was click. The button is part of a group component. </p>
  
  <p>the component is this:</p>
  
  <pre><code>&lt;fx:Metadata&gt;
      [Event(name="eventoConcluido", type="flash.events.Event")]
  &lt;/fx:Metadata&gt;
  &lt;fx:Script&gt;
      &lt;![CDATA[
          protected function endEventBtn(event:MouseEvent):void
          {
              var eventTerminado:Event = new Event("eventoConcluido");
              dispatchEvent(eventTerminado);
  
              //this.removeAllElements();
          }
      ]]&gt;
  &lt;/fx:Script&gt;
  
  &lt;s:Button id="endEvent" label="Test" color="black" width="100" click="endEventBtn(event);" /&gt;
  </code></pre>
  
  <p>And in application try to get this:</p>
  
  <pre><code>private var myArray:Array = [];
  private var myButton:Button;
  protected var comp1:test;
  
  public function addButton():void {  
  
      comp1= new test();
      myGroup.addElement(comp1);
      myArray.push(myGroup.addElement(comp1));
      comp1.endEvent.addEventListener(MouseEvent.CLICK, getButton);
  }
  
  public function getButton(event:MouseEvent):void {
      var ij:int= myArray.indexOf(event.currentTarget);
      trace(ij)// always get -1;
  }
  
  
  
  &lt;s:Button label="Add Button" click="addButton();" /&gt;
  </code></pre>
  
  <p>Is this actually possible?</p>