title: Events in Actionscript: How to get the instance name value by clicking the object on stage?
body: <pre><code>// I created four instance of movieclip on stage and named them t1_mc,t2_mc,t3_mc,t4_mc 
  
  // Then I made and array and loaded them inside the array
  
  var arr1:Array = new Array( t1_mc, t2_mc, t3_mc, t4_mc );
  
  
  var names:String;
  
  
  //function made to add event listener to each object
  
  function addListner():void
  
  {
  
         for ( var i:uint = 0; i &lt; arr1.length; i++ )
  
                     {
  
                    // Here We are creating four eventlisteners with a function  dispNm
  
                       names = arr1[i].name;
                         names + arr1[i].addEventListener(MouseEvent.CLICK, dispNm);
  
                     }
  
  }
  
  // this will run the function
  
  addListner();
  
  //next I created the dispNm method in this I am trying to get the value "t1" in output by clicking the object named "t1_mc" but I get error!!!!! 
  
  "1119: Access of possibly undefined property target through a reference with static type Class."
  
  function dispNm(e:MouseEvent):void
  
  {
  
      if( Event.target.name == 't1_mc')
  
      {
  
          trace('t1');
  
      }
  
  }
  </code></pre>
  
  <p>i don't know where Im wrong </p>
  
  <p>Please help......</p>