<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: [DefaultProperty] defines a default property. [duh]</title>
	<atom:link href="http://dispatchevent.org/mims/flex-manual-blues/feed/" rel="self" type="application/rss+xml" />
	<link>http://dispatchevent.org/mims/flex-manual-blues/</link>
	<description>Collective thoughts on Flash and Flex programming</description>
	<lastBuildDate>Mon, 22 Mar 2010 00:49:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Roger</title>
		<link>http://dispatchevent.org/mims/flex-manual-blues/comment-page-1/#comment-11</link>
		<dc:creator>Roger</dc:creator>
		<pubDate>Mon, 21 Aug 2006 21:01:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mimswright.com/?p=25#comment-11</guid>
		<description>How useless! I can&#039;t fault them too much, since in general Adobe did a great job of documenting flex. This is definitely one of those exceptions though...

Metadata tags are for when you&#039;re writing stuff in AS3 that you know is going to be used in MXML. Because MXML is eventually compiled down to AS3, this information is not necessary for the actionscript compiler, but it&#039;s good for the flex compiler. That&#039;s why the actionscript compiler is just going to ignore stuff standing alone inside brackets. [IBetItsABadIdea(&quot;to add comments this way!&quot;)]. But this is actually a particularly good example of things that make sense in MXML and not AS3.

Their example is, that when they coded the Label class they put in a [DefaultProperty(&quot;text&quot;)]. What the hell is a default property? It&#039;s when your MXML element has a text node as its child. In other words, when you just type inside the MXML tag, that stuff will be assigned to the default property.

&lt;mx:Label&gt;hi&lt;/mx:Label&gt;
is the same as
&lt;mx:Label text=&quot;hi&quot;/&gt;
is the same as
&lt;mx:Label&gt;&lt;mx:text&gt;hi&lt;/mx:text&gt;&lt;/mx:Label&gt;

because &quot;text&quot; is the default property.</description>
		<content:encoded><![CDATA[<p>How useless! I can&#8217;t fault them too much, since in general Adobe did a great job of documenting flex. This is definitely one of those exceptions though&#8230;</p>
<p>Metadata tags are for when you&#8217;re writing stuff in AS3 that you know is going to be used in MXML. Because MXML is eventually compiled down to AS3, this information is not necessary for the actionscript compiler, but it&#8217;s good for the flex compiler. That&#8217;s why the actionscript compiler is just going to ignore stuff standing alone inside brackets. [IBetItsABadIdea("to add comments this way!")]. But this is actually a particularly good example of things that make sense in MXML and not AS3.</p>
<p>Their example is, that when they coded the Label class they put in a [DefaultProperty("text")]. What the hell is a default property? It&#8217;s when your MXML element has a text node as its child. In other words, when you just type inside the MXML tag, that stuff will be assigned to the default property.</p>
<p>&lt;mx:Label&gt;hi&lt;/mx:Label&gt;<br />
is the same as<br />
&lt;mx:Label text=&quot;hi&quot;/&gt;<br />
is the same as<br />
&lt;mx:Label&gt;&lt;mx:text&gt;hi&lt;/mx:text&gt;&lt;/mx:Label&gt;</p>
<p>because &#8220;text&#8221; is the default property.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
