|
I was not in my topmost application file.... I was inside a
custom component file, that was being called by another custom component, which
was called by the topmost application file.
So, in theory, "this" should have referred to the proper
code. In fact, the same code (minus the changes for Point vs Object) in 1.5
produces the expected result.
Shan From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Gordon Smith Sent: Tuesday, August 08, 2006 3:27 PM To: [email protected] Subject: RE: [flexcoders] Finding the x/y position of an object
>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 Understanding what
'this' refers to is very important when writing Flex code. All the 'this'
references in a particular MXML document -- whether inside a <mx:Script>
block or in event handler attributes on tags -- refer to the same "document
object", the one represented by the topmost tag in the MXML file. If you are in
MyApplication. -
Gordon From:
[EMAIL PROTECTED] 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:
private function doThis(event: Shan From:
[EMAIL PROTECTED] 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. pt =
nestedObject. pt =
nestedObject. 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.
It's returning an odd value, like
0/90.... the actual x/y position of the object is somewhere around
350/275
-- -- -- -- 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 Shannon Hicks

