title: Flash AS3 addChild/assignment operator
body: <p>The Code bellow is a simplified version of what I am trying to do. My actual code involves copying an item from one array to another (which I am able to do). Then displaying the contents of both arrays on the stage. </p>
  
  <pre><code>//blueCircle is a library object with proper linkage set up.
  var ball = new blueCircle();
  ball.x=100;
  ball.y=100;
  addChild(ball);
  
  //This is the line that is giving me trouble.
  var anotherBall= ball;
  anotherBall.x=200;
  anotherBall.y=200;
  addChild(anotherBall);
  </code></pre>
  
  <p>When I run this code only 1 ball appears on the stage at (200,200).</p>
  
  <p>Is there another way to assign one value to another so that it will be duplicated rather then just adding a pointer to the original variable? if not is there a way to copy the instance of ball and add it to them memory location of another ball?</p>
  
  <p>I know that I could call: </p>
  
  <pre><code>var anotherBall= new blueCircle(); 
  </code></pre>
  
  <p>but this won't work for the application I am writing because the contents of the array I am trying to copy from are all different types of objects.</p>