3 Replies Latest reply on May 8, 2013 10:09 PM by kglad

    Custom Cursor

    Charine -FB buggoop Level 1

      I just used the code snippets to add my own custom curser to my game.

       

      The code snipped has a Mouse.hide(); code in to hide the normal cursor, but when I leave it in as given by the code snippets I get this error message:

       

      Scene 1, Layer 'Actions', Frame 1, Line 14 1120:Access of undefined property Mouse.

       

      If I comment the Mouse.hide(); line out, the new cursor works fine on top of everything else like it should BUT the normal cursor is also still there.

       

      Should I somehow define the mouse property in addition to this code?

       

      Here is all the code relevant to my problem.

       

      /* Custom Mouse Cursor

      Replaces the default mouse cursor with the specified symbol instance.

      This part works fine

      */

       

      stage.addChild(MyCursor);

      MyCursor.mouseEnabled = false;

      MyCursor.addEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor);

       

      function fl_CustomMouseCursor(event:Event)

      {

          MyCursor.x = stage.mouseX;

          MyCursor.y = stage.mouseY;

      }

       

      //And here is the code that is causing me problems

       

      Mouse.hide();

       

      Screenshot.png