mouse pointer

Community Beginner ,
Jun 02, 2021 Jun 02, 2021

Copy link to clipboard

Copied

how can i change the mouse pointer to movie clip or to object from the labrary?

Views

201

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
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Jun 02, 2021 Jun 02, 2021
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(...

Likes

Translate

Translate
Adobe Community Professional ,
Jun 02, 2021 Jun 02, 2021

Copy link to clipboard

Copied

Hi.

 

HTML5 or AS3?

 

Regards,

JC

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
community guidelines
Community Beginner ,
Jun 02, 2021 Jun 02, 2021

Copy link to clipboard

Copied

html5

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
community guidelines
Adobe Community Professional ,
Jun 02, 2021 Jun 02, 2021

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

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
community guidelines
Community Beginner ,
Jun 03, 2021 Jun 03, 2021

Copy link to clipboard

Copied

thank you

how i can back to the regular mouse? 

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
community guidelines
Adobe Community Professional ,
Jun 03, 2021 Jun 03, 2021

Copy link to clipboard

Copied

LATEST

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

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
community guidelines