You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Current »


  • Issue:

    • Mouse up event will be cancelled when multi-button down and release  the first one then the second one
    • How to test: left press, without releasing left button right click, release left and right mouse button, you'll only see one release event
      Your browser does not support canvas.
    • Source
      var stage, text;
       
      function init() {
              stage = new createjs.Stage("demoCanvas"); // Get EaselJS's stage to register to the canvas named "demoCanvas", can have multiple
       
      		linecount = 0;
       
      		text = new createjs.Text("Press:", "20px Arial", "#ff7700");
      		text.x = 10;
      		text.y = 10;
      
      		$('body').on('contextmenu', '#demoCanvas', function(event){ return false; });
       
      		stage.addChild(text);		
       
      		stage.addEventListener("stagemousedown", handleMouseDown);
      		stage.addEventListener("stagemouseup" , handleMouseUp);
      		createjs.Ticker.addEventListener("tick", tick);
          }
       
      function handleMouseDown(event){
      		text.text += "\r\n";
      		text.text += "Mouse Down Code = " + event.nativeEvent.button;
      	}
       
      function handleMouseUp(event){
      		text.text += "\r\n";
      		text.text += "Mouse Up   Code = " + event.nativeEvent.button;
      	}
       
      function tick(event){
      		stage.update();
      	}
       
      AJS.toInit( function(){
      	init();
      });

 

  • No labels