Skip to main content
Known Participant
June 2, 2021
Answered

mouse pointer

  • June 2, 2021
  • 1 reply
  • 733 views

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

    This topic has been closed for replies.
    Correct answer JoãoCésar17023019

    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

    1 reply

    JoãoCésar17023019
    Community Expert
    Community Expert
    June 2, 2021

    Hi.

     

    HTML5 or AS3?

     

    Regards,

    JC

    Yigal0D4BAuthor
    Known Participant
    June 2, 2021

    html5

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    June 2, 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();

     

     

    Regards,

    JC