Highlighted

Custom cursor not applied to body

New Here ,
Jul 08, 2014

Copy link to clipboard

Copied

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?

TOPICS
Development

Views

346

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Custom cursor not applied to body

New Here ,
Jul 08, 2014

Copy link to clipboard

Copied

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?

TOPICS
Development

Views

347

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 08, 2014 0
New Here ,
Jul 09, 2014

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 09, 2014 0
MikhailT LATEST
New Here ,
Aug 05, 2015

Copy link to clipboard

Copied

Hi there,


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

Could anybody help?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 05, 2015 0