Skip to main content
Participant
October 24, 2011
Answered

return to default cursor from a custom cursor

  • October 24, 2011
  • 1 reply
  • 1460 views

I'm working on an AS3 flash animation where I am using a custom cursor. At the end of the animation I want to default back to the regular arrow/hand cursor. Does anyone know how to/have some code to help me do that? Thank you!

This topic has been closed for replies.
Correct answer Ned Murphy

Sorry, I'm new at working with AS3 so I appreciate your patience.

The arrow cursor is there in addition to the magnifying glass - its not my decision to have it that way.

I want the magnifying glass to go away at say frame 300. How would the code look making it all invisible? Never done this before.

Thanks


At frame 300 you would have...

    Mouse.show();

    glass_mc.visible = false;

    line_mc.visible = false;

    stage.removeEventListener(MouseEvent.MOUSE_MOVE,moveGlass); 

1 reply

Ned Murphy
Legend
October 24, 2011

Somewhere in you code there should be a command: Mouse.hide();

which is what hides the cursor.  What you want to do to bring it back is use: Mouse.show();

and then you will ewant to set your customer cursor's visible property to be false or remove it from the display.

Participant
October 24, 2011

Re: return to default cursor from a custom cursor     

Thanks Ned.

I'm using a see-through effect (like a magnifying glass).

Here is the code I'm using:

stage.addEventListener(MouseEvent.MOUSE_MOVE,moveGlass); 

function moveGlass(myEvent:MouseEvent) {

    bigImage_mc.x = (mouseX * -.5);

    bigImage_mc.y = (mouseY * -.5);

    glass_mc.x = (mouseX);

    glass_mc.y = (mouseY);

    line_mc.x = (mouseX);

    line_mc.y = (mouseY);

    Mouse.show();   

}

The instances "glass_mc" and "line_mc" create the magnifying glass image. "bigImage" is what comes though the magnifying glass. Any thoughts on how to get rid of that so all I end up with is the default cursor?

Thanks again.

Ned Murphy
Legend
October 24, 2011

As I said, you need to turn the rest of the stuff invisible if you want it to go away.  I don't see where your code does that, nor do I see why you are adding the show() command when it appears yopu want to have the magnifier working.  If you want it to happen at the end of the animation, then that's where your code needs to execute showing the cursor and hiding the rest of the stuff.  At this point you are the only one who has any idea when the animation ends.