Monday, 10 October 2011

AS3: buttonMode = true and hand cursor still doesn't appear!

I was working on a large project that incorporated the Strobe Media player (SMP), but for some strange reason my buttons lost their hand cursor once the user interacted with the SMP.

I couldn't figure this out for a long time until I noticed that they were setting the hand cursor on the UI like so:

private function theMouseOut(e:MouseEvent):void {
   Mouse.cursor = flash.ui.MouseCursor.ARROW;
}

private function theMouseOver(e:MouseEvent):void {
   Mouse.cursor = flash.ui.MouseCursor.BUTTON;
}

which would override the default behaviour, once I added the same listeners to my own UI elements it was all sorted!

3 comments: