Flex - How do I get the absolute X and Y coordinate including HTML offset?
Posted
by Mauricio
on Stack Overflow
See other posts from Stack Overflow
or by Mauricio
Published on 2010-02-18T05:25:06Z
Indexed on
2010/03/30
15:13 UTC
Read the original article
Hit count: 302
Hey everyone,
I am calling a JS function through the ExternalInterface using Flex which requires the absolute X and Y coordinates to create a pop-up menu. The Flex application is displayed on the center of an HTML page, therefore there is an HTML X and Y offset to consider.
I have tried using the LocalToGlobal and ContentToGlobal functions, but these are just giving me the X and Y coordinates relative to the Flex application, it is not considering the HTML X and Y offset of having the Flex app in the center of the page or varying different screen resolutions.
Is the best approach to retrieve the HTML X and Y offset using JavaScript? Is there a Flex function I can use that provides the absolute X and Y coordinates based on the HTML page?
Thanks!
© Stack Overflow or respective owner