Skip to main content
Known Participant
Jun 2, 2021 5:10 PM UTC
Answered

mouse pointer

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

    This topic is closed to new replies. Start a new post to keep the conversation going.
    JoãoCésar17023019
    JoãoCésar17023019Correct answer
    Community Expert
    Jun 2, 2021 5:49 PM UTC

    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

    5 replies

    JoãoCésar17023019
    Community Expert
    Community Expert
    Jun 2, 2021 5:24 PM UTC

    Hi.

     

    HTML5 or AS3?

     

    Regards,

    JC

    Translate
    Yigal0D4BAuthor
    Known Participant
    Jun 2, 2021 5:26 PM UTC

    html5

    Translate
    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    Jun 2, 2021 5:49 PM UTC

    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

    Translate