Copy link to clipboard
Copied
how can i change the mouse pointer to movie clip or to object from the labrary?
Copy link to clipboard
Copied
Hi.
HTML5 or AS3?
Regards,
JC
Copy link to clipboard
Copied
html5
Copy link to clipboard
Copied
Here is a suggestion:
stage.mouseMoveHandler = function()
{
stage.customCursor.x = stage.mouseX / stage.scaleX;
stage.customCursor.y = stage.mouseY / stage.scaleY;
};
stage.canvas.style.cursor = "none";
stage.mouseMoveOutside = true;
stage.customCursor = new lib.YourLibSymbol(); // YourLibSymbol is the symbol's linkage name in the Library
stage.customCursor.mouseEnabled = false;
stage.addChild(stage.customCursor);
stage.on("stagemousemove", stage.mouseMoveHandler);
stage.mouseMoveHandler();
Regards,
JC
Copy link to clipboard
Copied
thank you
how i can back to the regular mouse?
Copy link to clipboard
Copied
Hi again.
Please try this:
stage.enableCustomCursor = function()
{
stage.canvas.style.cursor = "none";
stage.customCursor = new lib.YourLibSymbol();
stage.customCursor.mouseEnabled = false;
stage.addChild(stage.customCursor);
stage.mouseMove = stage.on("stagemousemove", stage.mouseMoveHandler);
stage.mouseMoveHandler();
};
stage.disableCustomCursor = function() // call this method when a frame starts, in a mouse event or whenever you want
{
stage.canvas.style.cursor = "default";
stage.removeChild(stage.customCursor);
stage.customCursor._off = true;
stage.customCursor = null;
stage.off("stagemousemove", stage.mouseMove);
};
stage.mouseMoveHandler = function()
{
stage.customCursor.x = stage.mouseX / stage.scaleX;
stage.customCursor.y = stage.mouseY / stage.scaleY;
};
stage.mouseMoveOutside = true;
stage.enableCustomCursor();
Regards,
JC