RE: [flexcoders] Re: Hittest for polygon UI Component

2008-07-08 Thread Alex Harui
I would examine transform of any suspected property.  It will show you
its true pixel bounds.  The width/height on UIComponent is set by its
parent and you can draw outside those numbers.  Maybe your drawing
algorithm is pushing stuff outside the expected area

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of richmcgillicuddy
Sent: Tuesday, July 08, 2008 10:37 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Hittest for polygon UI Component

 



Some more research. It happens on all zones that appear to be simple
or close to simple rectangles. Whether it shows up or not is merely a
z-order side effect. I do have one zone that is clearly not similar to
a rectangle and it seems to work properly.

Rich

On your questions, scaleX,Y are 1, the EventTarget is the MapZone in
question and I am looking at both the localX,Y and the StageX,Y so I
fairly certain they look correct.

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> The event.target and event.relatedObject of your mouse events are
> important, especially because localX/Y is relative to the event.target
> so you could just be reporting coordinates incorrectly.
> 
> 
> 
> Verify your targets and position. Keep in mind that scaling can also
> affect the way graphics are drawn.
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of richmcgillicuddy
> Sent: Tuesday, July 08, 2008 9:41 AM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: Hittest for polygon UI Component
> 
> 
> 
> 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
<mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui"  wrote:
> >
> > Show some code.
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of richmcgillicuddy
> > Sent: Tuesday, July 01, 2008 2:25 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] Re: Hittest for polygon UI Component
> > 
> > 

[flexcoders] Re: Hittest for polygon UI Component

2008-07-08 Thread richmcgillicuddy



Some more research. It happens on all zones that appear to be simple
or close to simple rectangles. Whether it shows up or not is merely a
z-order side effect. I do have one zone that is clearly not similar to
a rectangle and it seems to work properly.


Rich


On your questions, scaleX,Y are 1, the EventTarget is the MapZone in
question and I am looking at both the localX,Y and the StageX,Y so I
fairly certain they look correct.




--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> The event.target and event.relatedObject of your mouse events are
> important, especially because localX/Y is relative to the event.target
> so you could just be reporting coordinates incorrectly.
> 
>  
> 
> Verify your targets and position.  Keep in mind that scaling can also
> affect the way graphics are drawn.
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of richmcgillicuddy
> Sent: Tuesday, July 08, 2008 9:41 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Hittest for polygon UI Component
> 
>  
> 
> 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 <mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui"  wrote:
> >
> > Show some code.
> > 
> > 
> > 
> > ________________
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of richmcgillicuddy
> > Sent: Tuesday, July 01, 2008 2:25 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.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>
> <mailto:flexcoders%40yahoogroups.com>
> > , "Alex Harui"  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.
> > > 
> > > 
> > 

RE: [flexcoders] Re: Hittest for polygon UI Component

2008-07-08 Thread Alex Harui
The event.target and event.relatedObject of your mouse events are
important, especially because localX/Y is relative to the event.target
so you could just be reporting coordinates incorrectly.

 

Verify your targets and position.  Keep in mind that scaling can also
affect the way graphics are drawn.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of richmcgillicuddy
Sent: Tuesday, July 08, 2008 9:41 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Hittest for polygon UI Component

 

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 <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Show some code.
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of richmcgillicuddy
> Sent: Tuesday, July 01, 2008 2:25 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.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>
<mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui"  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%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.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>
<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
> >
>

 



[flexcoders] Re: Hittest for polygon UI Component

2008-07-08 Thread richmcgillicuddy
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"  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
> >
>




RE: [flexcoders] Re: Hittest for polygon UI Component

2008-07-01 Thread Alex Harui
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" <[EMAIL PROTECTED]> 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
>

 



[flexcoders] Re: Hittest for polygon UI Component

2008-07-01 Thread richmcgillicuddy
Could be the containers I am using but that is not what I am seeing.


Rich

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED] On
> Behalf Of richmcgillicuddy
> Sent: Monday, June 30, 2008 7:20 AM
> To: flexcoders@yahoogroups.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
>