Skip to main content
Known Participant
July 8, 2014
Question

Custom cursor not applied to body

  • July 8, 2014
  • 2 replies
  • 428 views

I have the following code which I run `onload` on the body tag in a HTML/JavaScript application:

var mcd = new window.runtime.flash.ui.MouseCursorData();

mcd.hotSpot = new air.Point(0,0);

mcd.frameRate = 24;

var loader = new air.Loader();

loader.contentLoaderInfo.addEventListener(air.Event.COMPLETE, function(event) {      

  var image = air.Bitmap(loader.content);    

  var bitmaps = new air.Vector["<flash.display.BitmapData>"]();

  bitmaps.push(image.bitmapData);

  mcd.data = bitmaps;

  air.Mouse.registerCursor('defaultCursor', mcd);

  air.Mouse.cursor = 'defaultCursor';

});

var request = new air.URLRequest('./assets/cursor.png');

loader.load(request);

However, this cursor ONLY appears when dragging the window chrome and doesn't appear anywhere else...

Is this a bug in AIR for HTML apps or do I need to call this code differently?

This topic has been closed for replies.

2 replies

MikhailT
Participant
August 5, 2015

Hi there,


I have the similar issue: Custom mouse pointer while dragging native window

Could anybody help?

Known Participant
July 9, 2014

Apparently there is also a 1px border around the stage (invisible) where the cursor change also applies... so this seems like a bug... any ideas? Thanks.