• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

mouse pointer

Explorer ,
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

427

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

Community Expert , 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(
...

Votes

Translate

Translate
Community Expert ,
Jun 02, 2021 Jun 02, 2021

Copy link to clipboard

Copied

Hi.

 

HTML5 or AS3?

 

Regards,

JC

Votes

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
Explorer ,
Jun 02, 2021 Jun 02, 2021

Copy link to clipboard

Copied

html5

Votes

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 Expert ,
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

Votes

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
Explorer ,
Jun 03, 2021 Jun 03, 2021

Copy link to clipboard

Copied

thank you

how i can back to the regular mouse? 

Votes

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 Expert ,
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

Votes

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