On Wed, Dec 24, 2008 at 11:20 PM, huhgawz <huhg...@yahoo.com> wrote:
> Let's say you have a Canvas in which you create multiple instances of a
> Circle randomly positioned. Then you want to know which Circles are
> underneath the top most Circle (talking in z-order terms) in order to hide
> them all.

  var n:int = canvas.numChildren;
  var topMostChild:DisplayObject = canvas.getChildAt(n - 1);

  for (var i:int = 0; i < n - 2; i++) {
    var c:DisplayObject = canvas.getChildAt(i);
    if (c.hitTestObject(topMostChild))
      c.visible = false;
  }

Try this.

-- 
manishjethani.com

Reply via email to