This bug has been a big problem in a project I'm currently on (Kid's game CD's), and I haven't seen a fix online so I thought I should post this (at least for myself as I'll forget : ).

When creating a custom cursor, you need to hide the existing arrow cursor -- Mouse.hide() works fine. However, in projectors (mac and win), when you right click and get the dialog, the cursor reappears. Ok, this is probably a bug, but you can just listen for a mouse up, and rehide the arrow cursor. However, on that Mac projector, this doesn't work. If you call hide again, even a million times in a row, the arrow is still visible, and exists over top whatever custom cursor you've made.

It ends up it will work if you call show again before calling hide. I suspect that there is something in there trying to be too smart - checking some internally set state that keeps track of cursor visibility, seeing that it is already invisible, and not bothering to make it invisible. That is probably out of whack due to the bug on right click. As a general rule I always try to run things like that anyway (when running them twice has no effect). If that isn't possible, then at least I try to check the state as close to home as possible (which in this case would be asking the OS). Of course that may well not be possible in this case, who knows.

I can't believe I've gotten this far without cursing the stupid mandatory right click dialog, that is my all time most hated thing about Flash. I don't care if it is hard, or even costly, sometimes you really really don't want to have that. At very least, it shouldn't also cause extra bugs, yuck.

Anyway, got my rant in, here is some code. The updateAfterEvent probably isn't needed, I was just being superstitious (it does cause an occasional slight arrow flicker - my mac is in the house or I'd test).

Mouse.hide();
var rcListener:Object = {};
rcListener.onMouseUp = function()
{
   Mouse.show();
   updateAfterEvent();
   Mouse.hide();
}
Mouse.addListener(rcListener);
posted on Monday, January 07, 2008 12:21 AM
Feedback
No comments posted yet.

Blog Stats

  • Posts - 120
  • Stories - 1
  • Comments - 390
  • Trackbacks - 47

.Net Blogs

01101 Blogs

Flash Blogs

Graphics

People