title: EaselJS: change shape fill color on mouse click
body: <p>I'm having an hard time working with EaselJS. Basically I want to create a simple grid and highlight the actual element selected:</p>
  
  <pre><code>var stageWidth = 800,
     stageHeight = 600,
     cell_size = 50,
     w = 16,
     h = 12,
     n = w * h,
     canvas,
     stage,
     background;
  
  $(document).ready(function(){
  
              canvas = $("#container")[0];     
              stage = new createjs.Stage(canvas);
  
              var x_pos = 0,
                  y_pos = 0,
                  res = 0,
                  grid_el;
  
              for(i=0;i&lt;n;i++){
  
                  res = i%w;
  
                  if(i&gt;0){
                      if(res===0){
                          x_pos = 0;
                          y_pos++;
                      } else {
                          x_pos++;
                      }
                  }
  
                  grid_el = new createjs.Shape();
                  grid_el.graphics.setStrokeStyle(2,"square").beginStroke("#000000");
                  grid_el.graphics.beginFill("#70FF85");
                  grid_el.graphics.rect(x_pos * cell_size,y_pos * cell_size,cell_size,cell_size);
                  grid_el.x_pos = x_pos * cell_size;
                  grid_el.y_pos = y_pos * cell_size;
                  grid_el.name = "quad";
  
                  stage.addChild(grid_el);
              }
  
              stage.update();
  
              stage.onMouseDown = function(e){
                  console.log(e);
                  var quad = this.getObjectsUnderPoint(e.stageX,e.stageY);
  
                  var clone = quad[0].graphics.clone();
                  clone.beginFill("#51D9FF");
  
                  quad[0].graphics = new createjs.Graphics(clone);
  
                  stage.update();
              }
  
          });         
  </code></pre>
  
  <p>I tried cloning the actual element graphics property, changing the fill color and then updating the stage, but I only obtain a white element, just like it didn't recognize the new graphics properties.</p>
  
  <p>Thanks for any help.</p>