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], "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?
>


Reply via email to