Alex,

The Polygon display object is called a MapZone. We've deconstructed
the application and still see the same behavior directly on the
application canvas. To create a MapZone and place it on the canvas,
the following code does this:

aZone = new MapZone();
aZone.zoneName = "Test Area";
aZone.toolTip = "Test Area";                    
aZone.setZoneCoordsString("124,249;198,249;198,316;124,316;");
this.addChild(aZone);

The mapZone extends a UIComponent and looks like:


public class MapZone extends UIComponent
        {

                public function MapZone()
                {   
                
                  super();
                  ...
                }

On processing the poly points, the location and size(height/width) of
the mapZone is set properly.

The drawing is in the UpdateDisplayList and looks like:
                override protected function 
updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void
        {               
                
                var nIndex : int;
                var xyString : String = new String();
                var lastX  : int = -1;
                var lastY  : int = -1;

                super.updateDisplayList(unscaledWidth,unscaledHeight);
                graphics.clear();
                // Set Fill
                Series of MoveTo's and LineTo's
}


Are there other things I need to set for a UIComponent. The behavior
we are seeing is that some zones will display the tooltip and mouse
events for a larger height than the zone actually is. We don't see
this behavior in the Y direction. An example from a trace is 

Zone Roll Over - TestZone (49,99) -
707,125;786,125;786,192;707,192;--707,125--67,79

Where (49,99) is the X,Y of the mouseevent, 67,79 is the Height/Width
of the MapZone and the polystring is provided. The mouse coordinates
(localX, localY) are larger that either dimension of the mapobject and
we double checked to see if we flip flopped any of the height/widths
and it does not appear like we have. The only place we see this is a
mapZone will think that it is taller than it really is. It displays
correctly, the upper x,y work fine and the left/right work fine as well.


Rich






--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Show some code.
> 
>  
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of richmcgillicuddy
> Sent: Tuesday, July 01, 2008 2:25 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Hittest for polygon UI Component
> 
>  
> 
> Could be the containers I am using but that is not what I am seeing.
> 
> Rich
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui" <aharui@> wrote:
> >
> > The area drawn inside a UIComponent doesn't have to be rectangular, we
> > just track everything by its bounding box.
> > 
> > 
> > 
> > If you drew a circle in there, it would only get mouse events on the
> > pixels in the circle, anything below would get the events in the
> > non-drawn area.
> > 
> > 
> > 
> > However, there is a hitTestPoint method.
> > 
> > 
> > 
> > ________________________________
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of richmcgillicuddy
> > Sent: Monday, June 30, 2008 7:20 AM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] Hittest for polygon UI Component
> > 
> > 
> > 
> > I have a series of objects that extend a UI Component and I correctly
> > draw a list of polypoints in the UIcomponent. I use the UIComponent
> > for the tooltips, mouse events and some other stuff. My probably is
> > that ultimately UIComponent is a rectangle. is there a different base
> > component I should use or is there a way for me to do a hittest on
> > mouse events to say whether the mouse is in/out of the component?
> > 
> > Rich
> >
>


Reply via email to