|
Well, for some reason when I specify "this" it always
referred to the application, not the object I was trying to get the x/y of.
Here's the fixed code:
var pt:Point = new Point(0,0); pt = event.target.contentToGlobal(pt); } Shan From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Gordon Smith Sent: Tuesday, August 08, 2006 3:10 PM To: [email protected] Subject: RE: [flexcoders] Finding the x/y position of an object
Are your code snippets
in the app file, where 'this' is a reference to the application? Or did you make
an MXML component based on HBox and the code snippets are from it so that 'this'
is the nested object? In neither case does it look like the right logic to
me. In an application
script, I think you want to do var
pt:Point = new Point(0, 0); // position of nestedObject in its own coordinates
(i.e., nestedObject' pt =
nestedObject. or (more complicated
and not recommended) var
pt:Point = new Point(nestedObject. pt =
nestedObject. Note that
localToGlobal( -
Gordon From:
[EMAIL PROTECTED] I have a nested object (an HBox) in
my app, and I'm trying to figure out the global x/y position of
it. I've tried
this:
var pt:Point = new
Point(this.x, But it always returns 0/0. Even if I
do this:
var pt:Point = new
Point(parent. It's returning an odd value, like
0/90.... the actual x/y position of the object is somewhere around
350/275 Any
ideas? Shan -- -- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
YAHOO! GROUPS LINKS
__,_._,___ -- |
- RE: [flexcoders] Finding the x/y position of an object Gordon Smith
- RE: [flexcoders] Finding the x/y position of an object Shannon Hicks
- RE: [flexcoders] Finding the x/y position of an obj... Gordon Smith
- RE: [flexcoders] Finding the x/y position of an... Shannon Hicks
- RE: [flexcoders] Finding the x/y position o... Gordon Smith

