Skip navigation
Currently Being Moderated

Custom Cursor

May 8, 2013 11:11 AM

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

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points