<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Dispatching Custom Events</title>
	<link>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/</link>
	<description>A digital supplement for the O'Reilly book</description>
	<pubDate>Fri, 30 Jul 2010 13:45:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Rich</title>
		<link>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-5953</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Wed, 24 Feb 2010 15:46:48 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-5953</guid>
		<description>@Jimfo, yes, you can pass any data type with an event. Check out the "Creating a Custom Event Class" section of the &lt;a href="/2008/11/11/passing-arguments-with-events/" rel="nofollow"&gt;Passing Arguments with Events&lt;/a&gt; post.</description>
		<content:encoded><![CDATA[<p>@Jimfo, yes, you can pass any data type with an event. Check out the &#8220;Creating a Custom Event Class&#8221; section of the <a href="/2008/11/11/passing-arguments-with-events/" rel="nofollow">Passing Arguments with Events</a> post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jimfo</title>
		<link>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-5951</link>
		<dc:creator>jimfo</dc:creator>
		<pubDate>Wed, 24 Feb 2010 15:35:18 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-5951</guid>
		<description>Is it possible to pass an object array or other data types other than strings in the event object? I have been trying to pass an array along with the event object. The eventData variable is an array. So when I try to do this then I get an implicit coercion error  can't convert array to string. I know that I can pass a string back split it up into an array using the split method of the String Class. Is there a way to pass native data types such as an array in the event object.

public override function clone():Event {
   return new CustomEvent(type, eventData, bubbles, cancelable);
}</description>
		<content:encoded><![CDATA[<p>Is it possible to pass an object array or other data types other than strings in the event object? I have been trying to pass an array along with the event object. The eventData variable is an array. So when I try to do this then I get an implicit coercion error  can&#8217;t convert array to string. I know that I can pass a string back split it up into an array using the split method of the String Class. Is there a way to pass native data types such as an array in the event object.</p>
<p>public override function clone():Event {<br />
   return new CustomEvent(type, eventData, bubbles, cancelable);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Felix</title>
		<link>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-4420</link>
		<dc:creator>Felix</dc:creator>
		<pubDate>Sun, 25 Oct 2009 01:27:34 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-4420</guid>
		<description>Hey Rich, thanks for the explaining.
I just made my own customEvent and it works fine!</description>
		<content:encoded><![CDATA[<p>Hey Rich, thanks for the explaining.<br />
I just made my own customEvent and it works fine!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich</title>
		<link>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-4373</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Thu, 22 Oct 2009 16:28:27 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-4373</guid>
		<description>@Felix, that line actually dispatches the event, just like pressing the mouse button dispatches an event like &lt;span class="inlineas"&gt;MOUSE_DOWN&lt;/span&gt;. 

The first part of the process is to create a new event, using &lt;span class="inlineas"&gt;new Event()&lt;/span&gt;. Within that structure, you include the event constant for the type of event you want to dispatch (in the example you cited, it was &lt;span class="inlineas"&gt;Event.CHANGE&lt;/span&gt;). Alternately, you can simply dispatch a string (which is what the event constants contain). The second part is to dispatch that newly created event with &lt;span class="inlineas"&gt;dispatchEvent()&lt;/span&gt;.

If you include a second argument (optional) &lt;span class="inlineas"&gt;true&lt;/span&gt; within the event creation step, the event will bubble up through the display list: &lt;span class="inlineas"&gt;dispatchEvent(new Event(Event.CHANGE, true));&lt;/span&gt;.

Thanks to Zevan for writing this post!</description>
		<content:encoded><![CDATA[<p>@Felix, that line actually dispatches the event, just like pressing the mouse button dispatches an event like <span class="inlineas">MOUSE_DOWN</span>. </p>
<p>The first part of the process is to create a new event, using <span class="inlineas">new Event()</span>. Within that structure, you include the event constant for the type of event you want to dispatch (in the example you cited, it was <span class="inlineas">Event.CHANGE</span>). Alternately, you can simply dispatch a string (which is what the event constants contain). The second part is to dispatch that newly created event with <span class="inlineas">dispatchEvent()</span>.</p>
<p>If you include a second argument (optional) <span class="inlineas">true</span> within the event creation step, the event will bubble up through the display list: <span class="inlineas">dispatchEvent(new Event(Event.CHANGE, true));</span>.</p>
<p>Thanks to Zevan for writing this post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Felix</title>
		<link>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-4372</link>
		<dc:creator>Felix</dc:creator>
		<pubDate>Thu, 22 Oct 2009 15:59:55 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-4372</guid>
		<description>Hey Rich nice book.

can you tell me what this line does?

dispatchEvent(new Event(Event.CHANGE));

I see people always put this line in the end, does this code tell flash to update the event?

Thanks</description>
		<content:encoded><![CDATA[<p>Hey Rich nice book.</p>
<p>can you tell me what this line does?</p>
<p>dispatchEvent(new Event(Event.CHANGE));</p>
<p>I see people always put this line in the end, does this code tell flash to update the event?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Jeffery</title>
		<link>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-3398</link>
		<dc:creator>Alex Jeffery</dc:creator>
		<pubDate>Wed, 29 Jul 2009 01:42:06 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-3398</guid>
		<description>Thanks for this tutorial. I had been looking for a clear example of custom events so I could implement a reusable toolbar widget for a Flash game.</description>
		<content:encoded><![CDATA[<p>Thanks for this tutorial. I had been looking for a clear example of custom events so I could implement a reusable toolbar widget for a Flash game.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Esteban</title>
		<link>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-2211</link>
		<dc:creator>Esteban</dc:creator>
		<pubDate>Thu, 05 Mar 2009 20:03:32 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-2211</guid>
		<description>Nice and clear example. The OpenSlider class is extremely useful. Thanx for sharing.
I will go on and read your other posts.
Cheers!</description>
		<content:encoded><![CDATA[<p>Nice and clear example. The OpenSlider class is extremely useful. Thanx for sharing.<br />
I will go on and read your other posts.<br />
Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich</title>
		<link>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-1092</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Thu, 06 Nov 2008 21:02:09 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-1092</guid>
		<description>Jim, this isn't possible in the given mechanism that AS3 uses for events. However, you can create a custom Event class that will allow this for specific uses. I'll write a post this weekend to show a simple example. It should be up by some time Monday afternoon.</description>
		<content:encoded><![CDATA[<p>Jim, this isn&#8217;t possible in the given mechanism that AS3 uses for events. However, you can create a custom Event class that will allow this for specific uses. I&#8217;ll write a post this weekend to show a simple example. It should be up by some time Monday afternoon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: What about adding a property for an event</title>
		<link>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-1091</link>
		<dc:creator>What about adding a property for an event</dc:creator>
		<pubDate>Thu, 06 Nov 2008 18:16:00 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/#comment-1091</guid>
		<description>What if you want to add data to the event being dispatched. So that your listener could grab some data from the event much like the COMPLETE event for an external XML Call. Is that possible.

Jim</description>
		<content:encoded><![CDATA[<p>What if you want to add data to the event being dispatched. So that your listener could grab some data from the event much like the COMPLETE event for an external XML Call. Is that possible.</p>
<p>Jim</p>
]]></content:encoded>
	</item>
</channel>
</rss>
