1 Reply Latest reply on Aug 28, 2009 3:05 PM by kglad

    How do I limit cursor change to stage area?

    sirrahe Level 1

      Greetings

      I have a Flash interaction where I exchange the cursor for a hand holding a flashlite mc. The entire stage is black. The cursor drags a mask around that illuminates a small image in another mc on the stage that the user has to find (illuminate).

       

      2 problems

       

      1. When the mouse is rolled outside the stage, the custom cursor is still visible.

      2. When imported into Captivate 3, and I move outside the stage and over buttons for navigation, the cursor is no longer visible, for the rest of the Captivate movie.

       

      Desired functionality

      Custom cursor to be visible only when on the stage area and the normal cursor to be visible outside the stage area. The stage area is 400x330.

       

      Code (AS2)

      Frame 1:

      =====================================

      stop();
      _xmouse=0;
      _ymouse=330;
      myInterval = setInterval (moveMask,50);

       

      function moveMask(){
             
          masker_mc._x=_xmouse + 20;
          masker_mc._y=_ymouse;
      }

       

      buttons_mc.setMask(masker_mc);

      ======================================

      On custom cursor:

      ======================================

      onClipEvent(load){
          Mouse.hide();
          startDrag("",true);
          }

      ======================================

        • 1. Re: How do I limit cursor change to stage area?
          kglad Adobe Community Professional & MVP

          about the best you can do (unless you use javascript) is to poll the mouse postion and show() or hide() it based on its proximity to the stage edge.  this has all sorts or problems if the mouse is moved rapidly.

           

          you can use some border shapes and use rollover events to trigger the mouse show() and hide() methods but there are still going unsatisfactory results if the mouse is moved rapidly enough.

          1 person found this helpful