<?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: Flash/Flex Events: Error Removing Child with Custom Event</title>
	<atom:link href="http://www.maximporges.com/2008/04/18/flashflex-events-error-removing-child-with-custom-event/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maximporges.com/2008/04/18/flashflex-events-error-removing-child-with-custom-event/</link>
	<description>Winning At Yelling</description>
	<lastBuildDate>Wed, 09 Nov 2011 16:13:16 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Maxim Porges</title>
		<link>http://www.maximporges.com/2008/04/18/flashflex-events-error-removing-child-with-custom-event/comment-page-1/#comment-258</link>
		<dc:creator>Maxim Porges</dc:creator>
		<pubDate>Wed, 23 Apr 2008 01:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.maximporges.com/?p=182#comment-258</guid>
		<description>I suppose you could always use mySpecialBox.addEventListener(OrderEvent.PLACE_ORDER, processOrder), but that&#039;s not quite as intuitive. &lt;br/&gt;&lt;br/&gt;Oh well. I guess we&#039;ll just have to treat event metadata as part of the object&#039;s contract and use care when refactoring as always.&lt;br/&gt;&lt;br/&gt;- max</description>
		<content:encoded><![CDATA[<p>I suppose you could always use mySpecialBox.addEventListener(OrderEvent.PLACE_ORDER, processOrder), but that&#8217;s not quite as intuitive. </p>
<p>Oh well. I guess we&#8217;ll just have to treat event metadata as part of the object&#8217;s contract and use care when refactoring as always.</p>
<p>- max</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://www.maximporges.com/2008/04/18/flashflex-events-error-removing-child-with-custom-event/comment-page-1/#comment-257</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Tue, 22 Apr 2008 20:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.maximporges.com/?p=182#comment-257</guid>
		<description>@Max - Ah that&#039;s cool to see, didn&#039;t know you could do that.  You still have to hard code the event attribute on the MXML however:&lt;br/&gt;&lt;br/&gt;&lt;view:MySpecialBox eventTypeName=&quot;myHandler();&quot; /&gt;&lt;br/&gt;&lt;br/&gt;I had the name part of the Event metadata and the attribute of the handling MXML tag as the same string, just the value of the type constant on the Event class was different.  Figured the metadata tag and the attribute on the handling tag just had to be the same, but that&#039;s not the case.  Oh well.</description>
		<content:encoded><![CDATA[<p>@Max &#8211; Ah that&#8217;s cool to see, didn&#8217;t know you could do that.  You still have to hard code the event attribute on the MXML however:</p>
<p>&lt;view:MySpecialBox eventTypeName=&#8221;myHandler();&#8221; /&gt;</p>
<p>I had the name part of the Event metadata and the attribute of the handling MXML tag as the same string, just the value of the type constant on the Event class was different.  Figured the metadata tag and the attribute on the handling tag just had to be the same, but that&#8217;s not the case.  Oh well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maxim Porges</title>
		<link>http://www.maximporges.com/2008/04/18/flashflex-events-error-removing-child-with-custom-event/comment-page-1/#comment-256</link>
		<dc:creator>Maxim Porges</dc:creator>
		<pubDate>Sun, 20 Apr 2008 00:55:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.maximporges.com/?p=182#comment-256</guid>
		<description>Oops - I&#039;m an idiot. You can absolutely do what I was saying you couldn&#039;t in my prior comment. I have successfully run a test app in FB3 that uses the static constant on the event to declare its type, like so:&lt;br/&gt;&lt;br/&gt;&lt;mx:Metadata&gt;&lt;br/&gt;   [Event(name=OrderEvent.PLACE_ORDER, type=&quot;OrderEvent&quot;)]&lt;br/&gt;&lt;/mx:Metadata&gt;&lt;br/&gt;&lt;br/&gt;- max</description>
		<content:encoded><![CDATA[<p>Oops &#8211; I&#8217;m an idiot. You can absolutely do what I was saying you couldn&#8217;t in my prior comment. I have successfully run a test app in FB3 that uses the static constant on the event to declare its type, like so:</p>
<p>&lt;mx:Metadata&gt;<br />   [Event(name=OrderEvent.PLACE_ORDER, type="OrderEvent")]<br />&lt;/mx:Metadata&gt;</p>
<p>- max</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maxim Porges</title>
		<link>http://www.maximporges.com/2008/04/18/flashflex-events-error-removing-child-with-custom-event/comment-page-1/#comment-255</link>
		<dc:creator>Maxim Porges</dc:creator>
		<pubDate>Sat, 19 Apr 2008 03:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.maximporges.com/?p=182#comment-255</guid>
		<description>Usually, I define event types as static constants on the Event subclass. I can then use these in calls to dispatchEvent() (when instantiating a new event by type) and adding event listeners using addEventListener().&lt;br/&gt;&lt;br/&gt;The one thing that really annoys me about what you are referring to is that you can&#039;t use a static constant to define the type in the metadata (unless I am mistaken). So, you end up with hard-coded strings with the even type in any classes that announce that event, i.e.:&lt;br/&gt;&lt;br/&gt;[Event(name=&quot;eventTypeName&quot;, type=&quot;&lt;i&gt;event class name here&lt;/i&gt;&quot;)]&lt;br/&gt;&lt;br/&gt;Kind of annoying, especially since they have to match as you described.&lt;br/&gt;&lt;br/&gt;- max</description>
		<content:encoded><![CDATA[<p>Usually, I define event types as static constants on the Event subclass. I can then use these in calls to dispatchEvent() (when instantiating a new event by type) and adding event listeners using addEventListener().</p>
<p>The one thing that really annoys me about what you are referring to is that you can&#8217;t use a static constant to define the type in the metadata (unless I am mistaken). So, you end up with hard-coded strings with the even type in any classes that announce that event, i.e.:</p>
<p>[Event(name="eventTypeName", type="<i>event class name here</i>")]</p>
<p>Kind of annoying, especially since they have to match as you described.</p>
<p>- max</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian LeGros</title>
		<link>http://www.maximporges.com/2008/04/18/flashflex-events-error-removing-child-with-custom-event/comment-page-1/#comment-254</link>
		<dc:creator>Brian LeGros</dc:creator>
		<pubDate>Fri, 18 Apr 2008 14:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.maximporges.com/?p=182#comment-254</guid>
		<description>Along a similar line, I tried creating a custom event and set the value of the event property &quot;type&quot; to a value different than what is listed as the &quot;name&quot; in my Metadata tag on the component.  My event never fired my event handler in MXML ... couldn&#039;t figure out why until I set them to the same value and it worked.  Turns out if your gonna handle an event via MXML, the type property, name on the metadata, and the attribute on the MXML tag all have to match.  Maybe I&#039;m an idiot and this is something that everyone knows to do, but it got me.</description>
		<content:encoded><![CDATA[<p>Along a similar line, I tried creating a custom event and set the value of the event property &#8220;type&#8221; to a value different than what is listed as the &#8220;name&#8221; in my Metadata tag on the component.  My event never fired my event handler in MXML &#8230; couldn&#8217;t figure out why until I set them to the same value and it worked.  Turns out if your gonna handle an event via MXML, the type property, name on the metadata, and the attribute on the MXML tag all have to match.  Maybe I&#8217;m an idiot and this is something that everyone knows to do, but it got me.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

