or if your container uses absolute positioning you would need to use
contentToGlobal
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Keun Lee
Sent: Friday, February 23, 2007 2:09 PM
To: [email protected]
Subject: Re: [flexcoders] Re: How to get the real X & Y of a
repeater item
Hey you might want to also look into "localToGlobal"
I.e
var comp : UIComponent = UIComponent(
event.target ); var point : Point = comp.localToGlobal(
new Point( comp.x, comp.y ) ); trace( point.x + ":" +
point.y );
-Keun
On 2/22/07 9:24 AM, "jer_ela" <[EMAIL PROTECTED]> wrote:
The following code gets the x and y positions of an
image that has
been clicked on that was generated by a repeater.
Getting the coords
for a button should be pretty much the same.
stageX and Y are the x and y coords of the mouse
position relative to
the application stage. mainCanvas is a direct child of
the application
and is the container that I want the coords relative to.
If you have
additional containers between the stage and the one you
need coords
relative to, you have to subtract the x and y at each
level to get
from stage coords to that container's coords.
Subtracting the mouseX
and Y moves the coords from the point or the click to
the upper left
corner of the image.
selectedImage.x = event["stageX"] - mainCanvas.x
- event.currentTarget.mouseX;
selectedImage.y = event["stageY"] - mainCanvas.y
- event.currentTarget.mouseY;
--- In [email protected]
<mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com> , "zipo13" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> In my app I create a repeater the generats VBoxes each
with button
in it.
> When the user clicks on the button I want to generate
a small dialog
> that will open up under the button.
> I know how to get the repeater current item and target
and current
> target but I can't find the real X & Y of the button.
> Am I going in the wrong direction?
>