1 Reply Latest reply on Mar 27, 2014 4:18 AM by Ned Murphy

    Increasing the Click Area of a Movie Clip

    TheEricBraun

      Hello,

       

      Right now i'm making a RTS style game sort of like Age of Empires. A current problem i'm having is when I click on my troop, it has to be a precice point in order for it to be selected, making it really hard to click on it since that precice point is so small (i'm guessing it's the registration point). I'm wondering if there's anyway you can make it so that instead of clicking just that small point, you can make it so that the troop is selected by clicking anywhere in the mc's area.

       

      What I have right now for code for clicking on the MC is this:

       

      soldier.onRelease = function() {

                iVN = 2;

      }

       

      and on the MC itself I have this (this is just part of the code on the MC, not all code on it):

       

      onClipEvent (mouseDown) {

                if (_root.iVN == 2) {

                          endX = _root._xmouse;

                          endY = _root._ymouse;

                          trace('Moving to location');

                }

      }

       

      Any help would be greatly appreciated.

       

      Kind Regards

        • 1. Re: Increasing the Click Area of a Movie Clip
          Ned Murphy Adobe Community Professional & MVP

          You should remove the code from the object and place it on the timeline. 

           

          The entire mc that has that code assigned to it should be effective in mouse interactions, not the registration point.  PArt of the problem night be the way you have it coded.  onRelease completes/occurs following a mouseUp interaction, so if you are expecting the value of _root.iVN to be == 2 while the mouseDown is in effect, it definitely will not be the first time you click down.

          1 person found this helpful