You may need to use the local / global conversion functions, like localtoGlobal()
Tracy ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of pbrendanc Sent: Friday, June 27, 2008 5:57 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: How to Position a Popup relative to the control that invoked the popup? Thx a bunch - this looks like what I need - however for some reason I'm seeing -ve numbers for my x + y coordinates and my popup is partway off my form/window - any further suggestions. Since my grid is dynamically created are there any other issues/gotcha's I need to consider here? TIA --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "Dimitrios Gianninas" <[EMAIL PROTECTED]> wrote: > > 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 = point.y + 10; > > Dimitrios Gianninas > Optimal Payments Inc. > > > > -----Original Message----- > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> on > behalf of pbrendanc > Sent: Thu 26/06/2008 7:55 PM > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] How to Position a Popup relative to the control that invoked the popup? > > 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 access the position/coordinates of the calling button - > is this data somehow available via the createComplete event of the > popup. I imagine this data is buried somewhere in the > event/eventtarget object, but I'm not quite sure how to access it. > > (Please don't tell me that I need to assign a listener to every button > in the grid from within the Popup window as I'm creating the grid > dynamically and it varies in size). > > Can anyone help with this, > > TIA, > Patrick > > > > > > > > -- > WARNING > ------- > This electronic message and its attachments may contain confidential, proprietary or legally privileged information, which is solely for the use of the intended recipient. No privilege or other rights are waived by any unintended transmission or unauthorized retransmission of this message. If you are not the intended recipient of this message, or if you have received it in error, you should immediately stop reading this message and delete it and all attachments from your system. The reading, distribution, copying or other use of this message or its attachments by unintended recipients is unauthorized and may be unlawful. If you have received this e-mail in error, please notify the sender. > > AVIS IMPORTANT > -------------- > Ce message électronique et ses pièces jointes peuvent contenir des renseignements confidentiels, exclusifs ou légalement privilégiés destinés au seul usage du destinataire visé. L'expéditeur original ne renonce à aucun privilège ou à aucun autre droit si le présent message a été transmis involontairement ou s'il est retransmis sans son autorisation. Si vous n'êtes pas le destinataire visé du présent message ou si vous l'avez reçu par erreur, veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses pièces jointes, de votre système. La lecture, la distribution, la copie ou tout autre usage du présent message ou de ses pièces jointes par des personnes autres que le destinataire visé ne sont pas autorisés et pourraient être illégaux. Si vous avez reçu ce courrier électronique par erreur, veuillez en aviser l'expéditeur. >