title: Finding a free area in the stage
body: <p>I'm drawing rectangles at random positions on the stage, and I don't want them to overlap.
  So for each rectangle, I need to find a blank area to place it.</p>
  
  <p>I've thought about trying a random position, verify if it is free with </p>
  
  <pre><code>private function containsRect(r:Rectangle):Boolean {
      var free:Boolean = true;
      for (var i:int = 0; i &lt; numChildren; i++)
          free &amp;&amp;= getChildAt(i).getBounds(this).containsRect(r);
      return free;
  }
  </code></pre>
  
  <p>and in case it returns false, to try with another random position.</p>
  
  <p>The problem is that if there is no free space, I'll be stuck trying random positions forever.</p>
  
  <p>There is an elegant solution to this?</p>