A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: mouse pointer

  1. #1
    Junior Member
    Join Date
    Jul 2014
    Posts
    2

    mouse pointer

    Hi,

    I've made an animation in the HTML5-canvas. It works perfectly. See: http://www.studio-ief.be/extra/potlood_HTML.html.

    Here's my javascript-code in frame 1:

    Code:
    this.stop();
    
    
    
    this.knop.addEventListener("mouseover", fl_Start.bind(this));
    
    function fl_Start() 
    { 
    this.play() ; 
    
    }
    
    
    this.knop.addEventListener("mouseout", fl_Pause.bind(this));
    
    function fl_Pause() 
    { 
    this.stop() ; 
    
    }
    
    How can I make the mouse-pointer default?
    Here's my javascript-code in the last frame:

    Code:
    this.gotoAndPlay(2);
    How can I make the mouse-pointer default? It has to stay an arrow, even on mouse over. Can someone help me with the Javascript-code?

    Thx!!

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    No need to alter that enormous javascript file, simpy change the code on your html file, like so.

    You have this already
    HTML Code:
    <script>
    var canvas, stage, exportRoot;
    
    function init() {
    	canvas = document.getElementById("canvas");
    	exportRoot = new lib.potlood_HTML();
    
    	stage = new createjs.Stage(canvas);
    	stage.addChild(exportRoot);
    	stage.update();
    	stage.enableMouseOver();
    
    	createjs.Ticker.setFPS(lib.properties.fps);
    	createjs.Ticker.addEventListener("tick", stage);
    }
    </script>
    add stage.cursor = "default"; somewhere after stage.enableMouseOver();

  3. #3
    Junior Member
    Join Date
    Jul 2014
    Posts
    2
    O.K., thanks. It works now!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center