title: Targetting multiple Stages' children by name in EaselJS
body: <p>(Continuation of <a href="https://stackoverflow.com/questions/34966537/dynamic-stage-name-in-easeljs">this question</a>.)</p>
  
  <p>So let's assume I have two stages and I want to update them simultaneously at a tick.</p>
  
  <pre><code>$( document ).ready(function() {
  
      context = "First";
      init();
      context = "Second";
      init();
  
      createjs.Ticker.addEventListener("tick", tick);
      createjs.Ticker.setFPS(12);
  });
  
  stages = [
      "First", "Second"
  ]
  
  canvases = {
      "First": [
          {"content": "small1.png"}
      ],
      "Second": [
           {"content": "small2.png"}
          ]
  };
  
  objects = [];
  
  function init() {
      window[context] = new createjs.Stage(context);
      stage = window[context];
      var graphics = new createjs.Graphics().beginFill("#ffdddd").drawRect(50, 50, 200, 200);
    var shape = new createjs.Shape(graphics);
      var image = new createjs.Bitmap(canvases[context][0].content);
      stage.addChild(shape);
      stage.addChild(image);
      stage.update();
  }
  
  function tick() {
      for (i = 0; i &lt; stages.length; i++) {
          stage = window[stages[i]];
          stage.shape.x = stage.shape.x +1;
          stage.update();
      }
  }
  </code></pre>
  
  <p>I'm able to create both stages and they both initiate correctly, loading the right images.</p>
  
  <p>My tick function isn't doing anything meaningful though, and I'm stuck at "how to target items in stages". I'm pretty sure stage.shape.x is bugging because shape was defined locally by init(), so that's expected; my question is how to target it properly. (Ideally, I need something else than "targeting by id within the stage" because I need the ability to target specific objects - for instance, "the object called image in the Second stage".)</p>