The "this" keyword refers to the outermost tag that is used in the mxml file. It doesn't matter where in the file you say "this". If you use it on an event handler on a button inside an application called foo.mxml, "this" refers to the application tag.
 
The only exception to this is if you use the Component tag. In that case, the "this" keyword refers to the embedded component whenever you are inside the Component tag.
 
Except for the component issue, details can be found here:
 
-Sho


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Anderson
Sent: Thursday, August 10, 2006 3:14 PM
To: [email protected]
Subject: [flexcoders] Overall consensus of using the "this" keyword

Hello All,

I am curious about the "this" keyword, as it relates to .MXML files.

As far as I know, you don't treat ActionScript any differently when it's
contained within .MXML files. But when it comes to using "this", I am a
little fuzzy - because I am seeing mixed examples of coding styles, and
all these examples are from well-known Flash/Flex Gurus...

When talking about an ActionScript Class - "this" is used of course,
when referring to Variables that were declared in the main constructor -
and helps keep those Variables separate from other Variables
(potentially with the same name) that are local to functions.

My question is, do all these same rules apply, to ActionScript that is
contained within .MXML files?

I know this may sound like a goofy topic, but I would love to have it
clarified - so I can continue to write quality code, that conforms to
the latest coding standards/techniques.

Thanks in advance,

Mike

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





YAHOO! GROUPS LINKS




__,_._,___

Reply via email to