Hello!
I have a problem. How can i add buttonMode (Hand Cursor) to Play/Pause button in FLVPlayback player? I tried everything...
Mazoonist
11-27-2009, 03:10 PM
There may or may not be a way to do this from the inside. There is a way to cheat it from the outside. It requires flash player 10 to get the new "cursor" property of the Mouse class. So here's what I did:
1. Drew a rectangle on a separate layer above the FLVPlayback component the same size as the playPauseButton. I used a fill color with alpha set to 0, and no stroke. Then converted the rectangle to a MovieClip symbol, and gave the instance a name of "hitspot."
2. In the code, set hitspot's mouseEnabled property to false so that it doesn't get mouse events. That way, clicks on the real button will still register even though hitspot is covering it physically.
3. Also in the code, add an event listener for ENTER_FRAME that continually checks to see if the mouse is over hitspot, using hitTestPoint (using rollovers wouldn't work, because you can't have rollover events while keeping mouseEnabled set to false). If the mouse is hitting the hitspot, use the MouseCursor.BUTTON cursor, otherwise use the MouseCursor.ARROW cursor.
It may be a bit of a hack, but if all you care about is the visual effect of getting a hand cursor over the button, it will definitely work. I've attached the file. With the FLVPlayback component included in the file, it barely made it within the file size limit imposed here on the forum, but I thought I'd include it for clarity's sake. The file is Flash CS4 format.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.