Highlighted

Custom Cursor HTML5 Error

New Here ,
Sep 12, 2017

Copy link to clipboard

Copied

Just recently I have been having issues with custom cursors. In the top left of my canvas, the cursor works perfectly. The farther I move my mouse from there, the farther my custom cursor goes away from where my cursor should be. I've provided a video showing what I mean. In a project I am working on currently the cursor was functioning perfectly. I didn't touch the movie clip or the code and suddenly it started doing the same thing as test movie below. I did update to the newest version of Animate between the cursor working fine and having this bug. Additionally, I tried creating a drag and drop but the same error happens with what I'm trying to drag. The object drifts away from the cursor. Testing this issue, it seems to only be a problem for mac users, maybe just by coincidence?

This is my code:

stage.canvas.style.cursor = "none";

this.wand.mouseEnabled = false;

this.addEventListener("tick", fl_CustomMouseCursor_2.bind(this));

function fl_CustomMouseCursor_2() {

this.wand.x = stage.mouseX;

this.wand.y = stage.mouseY;

}

*I recently updated to the 16.5.1 release.

Adobe Community Professional
Correct answer by Colin Holgate | Adobe Community Professional

The stage itself has a scale. Try dividing the stage.mouseX by the stage.scaleX (not simply dividing by 2).

Views

1.1K

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 HTML5 Error

New Here ,
Sep 12, 2017

Copy link to clipboard

Copied

Just recently I have been having issues with custom cursors. In the top left of my canvas, the cursor works perfectly. The farther I move my mouse from there, the farther my custom cursor goes away from where my cursor should be. I've provided a video showing what I mean. In a project I am working on currently the cursor was functioning perfectly. I didn't touch the movie clip or the code and suddenly it started doing the same thing as test movie below. I did update to the newest version of Animate between the cursor working fine and having this bug. Additionally, I tried creating a drag and drop but the same error happens with what I'm trying to drag. The object drifts away from the cursor. Testing this issue, it seems to only be a problem for mac users, maybe just by coincidence?

This is my code:

stage.canvas.style.cursor = "none";

this.wand.mouseEnabled = false;

this.addEventListener("tick", fl_CustomMouseCursor_2.bind(this));

function fl_CustomMouseCursor_2() {

this.wand.x = stage.mouseX;

this.wand.y = stage.mouseY;

}

*I recently updated to the 16.5.1 release.

Adobe Community Professional
Correct answer by Colin Holgate | Adobe Community Professional

The stage itself has a scale. Try dividing the stage.mouseX by the stage.scaleX (not simply dividing by 2).

Views

1.1K

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
Sep 12, 2017 0
Contributor ,
Sep 12, 2017

Copy link to clipboard

Copied

While you shouldn't have to update the code to get it to work again, but for now you could try multiplying the stage.mouseX and stage.mouseY values by 2. The reason why something doesn't work anymore usually pop up eventually so it's good to be able to move on until then.

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...
Sep 12, 2017 0
Adobe Community Professional ,
Sep 12, 2017

Copy link to clipboard

Copied

The stage itself has a scale. Try dividing the stage.mouseX by the stage.scaleX (not simply dividing by 2).

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...
Sep 12, 2017 1
New Here ,
Sep 14, 2017

Copy link to clipboard

Copied

Colin! This worked really well on my computer but now the others that were not having issues with the file are only able to drag the custom cursor halfway across the stage. Do you have any idea why we are having the issue only on a few computers?

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...
Sep 14, 2017 0
Adobe Community Professional ,
Sep 14, 2017

Copy link to clipboard

Copied

There is another thing that may be important, if your custom cursor is inside a movieclip you may need to convert the global x and y to a local x and y value. See this:

EaselJS v0.8.2 API Documentation : DisplayObject

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...
Sep 14, 2017 0
Noar drw LATEST
New Here ,
Apr 06, 2020

Copy link to clipboard

Copied

Hi, I'm french and I have the same problem but I don't know where you find this code and how do I do to modify it to make it work !

 

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...
Apr 06, 2020 0