title: AS3 - How to copy sprites / graphics of sprites?
body: <p>Let's say I have a 2D level that is build out of 2D blocks. Some of them are boxes.</p>
  
  <p>The boxes look <strong>just the same</strong>. No difference! How can I "copy" or clone the graphics of one box to another ? The <strong>only</strong> difference the boxes will have is that <code>sprite.x</code> and <code>sprite.y</code> have different values. I would probably go that way:</p>
  
  <pre><code>public static function drawBox(graphics:Graphics):void
  {
      graphics.clear();
      // draw box
  }
  
  drawBox(box1.graphics);
  drawBox(box2.graphics);
  drawBox(box3.graphics);
  </code></pre>
  
  <p>No textures will be used, only vector drawing!</p>
  
  <p>Is this a good practice ? Is there another way to achieve the same ?
  <hr>
  <strong>Update:</strong> Sometimes I draw sprites randomly (very hard to redraw them if I need many instances of one sprite and all its attributes).</p>