Overlapped is a little different than 'being at a lower depth.' It looks to me like you're looking for some collision detection in addition to depth sorting, as in "if one circle overlaps the other (collides with), then hide the lower one". That's simple if you're comparing two circles. But the moment you get into n-overlapping circles, you're going to have to look into more complex logic, like figuring out which /group/ of circles overlaps, as a subgroup of the whole, and amongst just /those/ circles, hide all those underneath.
The best place to start is to look into collision detection routines. First place to look would be the hitTest() method of the DisplayObject class. But that only gives you bounding box collision -- if you're looking for pixel-level collision detection, look into the hitTest() method of the BitmapData class. _______________________________________________________________ Joseph Balderson, Flex & Flash Platform Developer | joeflash.ca Author, Professional Flex 3 | http://tinyurl.com/profx3book huhgawz wrote: > Thanks for you fast response. Your suggestion works but it is not what > I'm looking for. I'm sorry I guess I didn't explain well. > > So here I come again: > > Taking into account my previous example (the one with a Canvas and > multiple Circles positioned randomly)...I need to hide all those > Circles that are totally overlapped by other Circles. > > Could someone help me with this? > > --- In [email protected], Lushen Wu <l...@...> wrote: >> huhgawz, >> >> I think most UIComponents subclass DisplayObjectContainer, which has a >> method >> >> getChildIndex <#getChildIndex%28%29>(child:DisplayObject >> <../../flash/display/DisplayObject.html>):int <../../int.html> >> >> so call this to find the child index (basically z-order) of the >> lowest-ordered circle you want to have visible, >> >> then iterate all the Children underneath that index using the property >> numChildren and method getChildAt <#getChildAt%28%29>(index:int >> <../../int.html>):DisplayObject <../../flash/display/DisplayObject.html> >> and set them visible=false >> >> ref: >> > http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html >> >> Hope that helps.. >> >> Lushen >> >> >> On 12/24/2008 12:50 PM, huhgawz 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. >>> >>> Could you share an example of this? >>> >>> I would really appreciate any guidance.... >>> >>> > > > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Alternative FAQ location: > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links > > > >

