var bitmapDatas:Vector.<BitmapData> = new Vector.<BitmapData>( 1, true );
bitmapDatas[0] = new cursorTarget();
var cursorData:MouseCursorData = new MouseCursorData( );
cursorData.hotSpot = new Point( 15, 15 );
cursorData.data = bitmapDatas;
Mouse.registerCursor( CURSOR_TARGET, cursorData );
Mouse.cursor = CURSOR_TARGET;
The PNG I’m using is:
In the library, I have target.png exported for ActionScript as Class ‘cursorTarget’
With the above code, I get a 32x32 opaque white box. I’ve tried a dozen different variations, including creating a blank transparent BitmapData and draw()ing the cursor onto it. This also results in a white box. If I draw() a sprite (something I built in Flash), then it’s an opaque black box.
The only time I can get it to draw “correctly” is if I do something like: new BitmapData( 32, 32, true, 0x80FF0000); Then I get a half-transparent red box. (Also, using graphics.drawPath, etc, it rendered correctly as well.)
What do I have to do to get the PNG displaying as a cursor?