I think hitTestObject() checks to see if the rectangular boxes that bound the drawn pixels on two Sprites intersects. From your description I don't know if that is the problem or not.
- Dan Freiman On Jan 25, 2008 3:20 PM, Alex Harui <[EMAIL PROTECTED]> wrote: > Interesting. I've never used hitTestObject. Do you get the same for > hitTestPoint? > > > ------------------------------ > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *toofah_gm > *Sent:* Friday, January 25, 2008 11:57 AM > > *To:* flexcoders@yahoogroups.com > *Subject:* [flexcoders] Re: getRect returns rectangle that includes > children's bounds, is there an alter > > > > The problem is that I am getting hits on parts of the objects that are > masked. :( > > Thanks again for your help. > > --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, "Alex > Harui" <[EMAIL PROTECTED]> wrote: > > > > I'm not sure what problem you're having with hitTestObject. If the > > objects are visible (not masked) they should be hittable. > > > > > > > > ________________________________ > > > > From: flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com> [mailto: > flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>] On > > Behalf Of toofah_gm > > Sent: Friday, January 25, 2008 10:45 AM > > To: flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com> > > Subject: [flexcoders] Re: getRect returns rectangle that includes > > children's bounds, is there an alter > > > > > > > > I was hoping to take advantage of the translation to the > > targetCoordinateSpace that is being done underneath the covers of > > getRect()...if I need to use the width/height of the parent component, > > I will need to do this translation myself. I can do this, but was > > hoping that I was just missing something here. > > > > Any idea how this problem relates to the hitTestObject() matches? > > > > Thanks again for your quick response!!! > > > > --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com><mailto: > flexcoders%40yahoogroups.com> > > , "Alex Harui" <aharui@> wrote: > > > > > > Properly designed UIComponent subclasses report a measuredWidth/Height > > > (and measuredMinWidth/MinHeight) via the measure() method, and are > > > subsequently given a size by their parent which may not be those sizes > > > in updateDisplayList() where they draw graphics and/or size place > > > children. Those children may extend outside the bounds and may be > > > masked if needed. However, the width and height properties of the > > > UIComponent will be the size given by the parent while getRect will > > > return the bounding box of the children > > > > > > > > > > > > ________________________________ > > > > > > From: flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com><mailto: > flexcoders%40yahoogroups.com> > > [mailto:flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com><mailto: > flexcoders%40yahoogroups.com> > > ] On > > > Behalf Of toofah_gm > > > Sent: Friday, January 25, 2008 10:29 AM > > > To: flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com> <mailto: > flexcoders%40yahoogroups.com> > > > Subject: [flexcoders] getRect returns rectangle that includes > > children's > > > bounds, is there an alternate > > > > > > > > > > > > I want to use getRect to get the bounds of my UIComponent. > > > > > > I just noticed that if my UIComponent has children that extend beyond > > > the X/Y/Width/Height of my parent UIComponent, the rect returned > > > extends to the boundaries of the largest child. > > > > > > Is there an alternate method that I could use? My hack to get around > > > this is to override getRect and have it use another child that I force > > > to be the size of the parent, whose size I am interested in. > > > > > > Thanks! > > > > > > Another problem that I see seems related. The hitTestObject method > > > seems to have the same problem. It seems to be finding matches even > > > though the parent UIComponent is clearly not a match. It must also be > > > using boundaries of the children. > > > > > > Any thoughts? > > > > > > Thanks! > > > > > > > >