title: Flash Canvas responsive animation size
body: <p>Is it possible for an animation built with Flash Canvas to be responsive in the browser? By that I mean that I would like both the canvas and the animation itself to re-size themselves based on the size of the browser window while maintaining the original aspect ratio.</p>
  
  <p>The code I get from publishing my canvas is the following and although I've been trying all day to figure this out, I can't get it right.</p>
  
  <pre><code>&lt;script&gt;
  var canvas, stage, exportRoot;
  
  function init() {
      canvas = document.getElementById("canvas");
      exportRoot = new lib.test_1();
  
      stage = new createjs.Stage(canvas);
      stage.addChild(exportRoot);
      stage.update();
  
      createjs.Ticker.setFPS(lib.properties.fps);
      createjs.Ticker.addEventListener("tick", stage);
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;canvas id="canvas" width="640" height="360" style="background-color:#FFFFFF"&gt;&lt;/canvas&gt;
  </code></pre>
  
  <p>Can someone please help me? I don't have a lot of experience with java script or canvas and my attempts at updating the code haven't gotten me too far. With the help of another post here on stackoverflow I managed to have my canvas be responsive, but not the animation too. The animation just stayed in the same spot. Thank you very much in advance! Bellow is the code that made my canvas responsive if its any help:</p>
  
  <pre><code>&lt;script&gt;
  var canvas, stage, exportRoot, myCanvas;
  
  function init() {
      canvas = document.getElementById("canvas");
      exportRoot = new lib.test_1();
  
      stage = new createjs.Stage(canvas);
      stage.addChild(exportRoot);
      stage.update();
  
      createjs.Ticker.setFPS(lib.properties.fps);
      createjs.Ticker.addEventListener("tick", stage);
  
      var myCanvas = document.getElementById("canvas");
      myCanvas.width = document.documentElement.clientWidth;
      myCanvas.height = document.documentElement.clientHeight;
  
      window.addEventListener("resize", resizeCanvas, false);
  
      function resizeCanvas (e) {
      var myCanvas = document.getElementById("canvas");
  
      myCanvas.width = document.documentElement.clientWidth;
      myCanvas.height = document.documentElement.clientHeight;
  }
  
  }
  &lt;/script&gt;
  </code></pre>