3 Replies Latest reply on May 21, 2009 11:24 AM by Flex harUI

    Get current target, assign to object?

    Handycam Level 1

      I have an object which extends MovieClip.  There are multiple instances created of it on the stage.

       

      The handler for the click event is:

       

      private function hotSpotClickHandler(e:Event):void {

      // make a mask that matches the size and position of the hot spot clicked on

      makeMask(e.currentTarget.width,e.currentTarget.height,e.currentTarget.x,e.currentTarget.y) ;

      }

       

      I was looking for a way to not have to type e.currentTarget... every time.  I tried adding a line:

       

      var obj:Object =  new Object(e.current.target)

       

      so I could just say obj.width, obj.height etc.  But this did not work since e.current.target returns two parameters [object MovieClip].

       

      How could I accomplish this?