|
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's coordinates) pt = nestedObject.localToGlobal(pt)
// position of nestedObject in global coordinates or (more complicated and not recommended) var pt:Point = new
Point(nestedObject.x, nestedObject.y); // position of nestedObject in its
parent's coordinates (i.e., nestedObject.parent's coordinates) pt =
nestedObject.parent.localToGlobal(pt) // position of nestedObject in global
coordinates Note that localToGlobal() returns a new
Point; it doesn't change the Point passed in. - Gordon From:
[email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Shannon Hicks 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

