[flexcoders] How to Position a Popup relative to the control that invoked the popup?

2008-06-26 Thread pbrendanc
I have a grid with an array of buttons that when clicked, will display a popup window that collects user info. What I'd like to do is position the popup relative (immediately below) the button that the user clicked within the grid - not necessarily centered on the current window. How can I get

Re: [flexcoders] How to Position a Popup relative to the control that invoked the popup?

2008-06-26 Thread Josh McDonald
You should be able to get the button which triggered the click event from event.target -Josh On Fri, Jun 27, 2008 at 9:55 AM, pbrendanc [EMAIL PROTECTED] wrote: I have a grid with an array of buttons that when clicked, will display a popup window that collects user info. What I'd like to do

RE: [flexcoders] How to Position a Popup relative to the control that invoked the popup?

2008-06-26 Thread Dimitrios Gianninas
I think what you what is this: 1)from the click event get the ref to the button: var btn:Button = event.target as Button; 2) then get its coordinates: var point:Point = new Point(0, 0); point = btn.globalToLocal( point ); 3) now use it to position your pop up mypop.x = point.x; mypop.y =

Re: [flexcoders] How to Position a Popup relative to the control that invoked the popup?

2008-06-26 Thread Josh McDonald
Keeping in mind that scrollbars can mess up localToGlobal(), it's a known bug. Actually I haven't tested that in Flex 3 release, maybe it's fixed but I don't think so :) -Josh On Fri, Jun 27, 2008 at 12:14 PM, Dimitrios Gianninas [EMAIL PROTECTED] wrote: I think what you what is this: