4 Replies Latest reply on Aug 12, 2010 7:41 AM by snowgage

    change response area of MOUSE_OVER event on a line

    snowgage Level 1

      I have some lines that I am assigning actions to upon MOUSE_OVER    

       

      The problem is that they are relatively small and kind of finicky to get the mouse directly over.  When the mouse_over event occurs, I am changing their color to indicate they've been selected.

       

      Is there a way I can change how sensitive they are to the mouse over event (i.e. detect MOUSE_OVER within 10 pixels of each MC or something)?

       

      Here's the code I am using to asign the listeners and then to create a MOUSE_OVER event.

       

      //create listeners for all biketrails mc's and designate functions
      function createListenersbk():void{
      for(var i:uint=0;i<bktrlXml.row.length();i++){
      var mc:MovieClip = MovieClip(allview.allthings.bktrls.getChildByName(bktrlXml.row[i].idlink));
      mc.ivar = i;
      mc.addEventListener(MouseEvent.MOUSE_OVER,bktrlsover);
      mc.addEventListener(MouseEvent.MOUSE_OUT,bktrlsout);
      trace(i);
      }}

       

      //function for mousing over a bike trails MC
      function bktrlsover(e:MouseEvent):void{
      var ct:ColorTransform=e.currentTarget.transform.colorTransform;
      ct.color=0xF20A0A;
      e.currentTarget.transform.colorTransform=ct
      }

       

      function bktrlsout(e:Event):void{
      var ct:ColorTransform=e.currentTarget.transform.colorTransform;
      ct.color=0xBC1D1D;
      e.currentTarget.transform.colorTransform=ct
      }