title: AS3 - Array called into a new function... HOW?
body: <p>Sup everyone, well since my last post as been super fast to fix due to my tired eyes. I'm gonna ask you one more favor...</p>
  
  <p>It's about an Array, so before i had only one "target" showing. So i thought my game was way to simple...</p>
  
  <p>So i decided to add more target that moves, and place with random math...
  Well they are correctly placed, but only one is moving. I think is the first one that is being created....</p>
  
  <p>This is my line of code :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// Creating multiple targetwith ADDCHILD and ARRAY at different location //
  
  var arraymc_target:Array = [];
  for(var i:int = 1; i&lt;8; i++)
  {
      var mc_target:target = new target();
      mc_target.x = Math.floor(Math.random() * 400);
      mc_target.y = Math.floor(Math.random() * 550);
   addChild(mc_target);
      arraymc_target.push(mc_target);
  }
  
  // Creating the TARGETS MOVEMENT  //
  function goesside_1(event:Event):void {
   mc_target.x -= 2;
    if (mc_target.x &lt; -20){
    mc_target.x = 550;
  }
  }
  mc_target.addEventListener(Event.ENTER_FRAME, goesside_1);
  
  // ----------------------------------------------- //</code></pre>
  </div>
  </div>
  </p>