3 Replies Latest reply on Apr 28, 2006 5:09 PM by OniLink

    Mouse & Cursor

    OniLink
      This is the script I am using. It works up until you move the mouse really quick off the stage and it doesn't catch it in time:

      this.onEnterFrame = function() {
      if (_xmouse>5 && _xmouse<744 && _ymouse>5 &&_ymouse<517) {
      Mouse.hide();
      cursor._alpha = 100;
      cursor._x = _xmouse;
      cursor._y = _ymouse;
      } else {
      Mouse.show();
      cursor._alpha = 0;
      }
      }

      Is there a way to work around this? Thanks for any help,
      ~Oni.
        • 1. Re: Mouse &amp; Cursor
          Level 7
          OniLink wrote:
          > This is the script I am using. It works up until you move the mouse really
          > quick off the stage and it doesn't catch it in time:
          >
          > this.onEnterFrame = function() {
          > if (_xmouse>5 && _xmouse<744 && _ymouse>5 &&_ymouse<517) {
          > Mouse.hide();
          > cursor._alpha = 100;
          > cursor._x = _xmouse;
          > cursor._y = _ymouse;
          > } else {
          > Mouse.show();
          > cursor._alpha = 0;
          > }
          > }

          you could change it from onEnterFrame to onMouseMove to get it to run
          the code more frequently... or you could up the framerate so the
          onEnterFrame runs more quickly. 24fps is a good setting in general.

          --
          MOLOKO
          Macromedia Certified Flash MX 2004 Developer
          Macromedia Certified Flash MX Developer
          ------------------------------------------------
          ::remove _underwear_ to reply::
          'There ain't no devil - it's just God when he's drunk' Tom Waits
          ------------------------------------------------
          GCM/CS/IT/MC d-- S++:- a- C++ U--- P+ L++ !E W+++$ N++ O? K+ w+++$ !O M+
          VMS? PS+++ PE- Y PGP+ t+ 5-- X-- R* tv++ b++++ DI++++ D+ G e h-- r+ y++
          • 2. Re: Mouse &amp; Cursor
            OniLink Level 1
            I'm using 40fps. I'll try the onMouseMove
            • 3. Re: Mouse &amp; Cursor
              OniLink Level 1
              It works. Thanks mate.