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.
The stage itself has a scale. Try dividing the stage.mouseX by the stage.scaleX (not simply dividing by 2).
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.
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).
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?
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:
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 !