<?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: Tutorial &#8211; Understanding Classes in AS3 Part 4</title>
	<atom:link href="http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/</link>
	<description>We Make Flash Games</description>
	<lastBuildDate>Thu, 09 Sep 2010 15:56:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Bobby</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-5017</link>
		<dc:creator>Bobby</dc:creator>
		<pubDate>Tue, 02 Feb 2010 05:04:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-5017</guid>
		<description>@Andres F. and Ryan:

you can shorten your code even shorter by combining the custom event and passing of the variable into one line.

&lt;code&gt;dispatchEvent(new VendingMachineEvent(VendingMachineEvent.RETURN_SNACK, snack));&lt;/code&gt;

for others wanting to know what the VendingMachineEvent class would look like:

&lt;code&gt;
package
{
	import flash.events.Event;

	public class VendingMachineEvent extends Event
	{
		public var snack:*;
		
		public static const RETURN_SNACK:String = &quot;ReturnSnack&quot;;
		
		public function VendingMachineEvent(type:String, snack:*)
		{
			this.snack = snack;
			super(type);
		}
	}
}
&lt;/code&gt;

and then like Andres mentioned, your receiver method:

&lt;code&gt;
		private function getASnack(e:VendingMachineEvent):void
		{
			var mySnack:[what type] = e.snack;
		}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>@Andres F. and Ryan:</p>
<p>you can shorten your code even shorter by combining the custom event and passing of the variable into one line.</p>
<p><code>dispatchEvent(new VendingMachineEvent(VendingMachineEvent.RETURN_SNACK, snack));</code></p>
<p>for others wanting to know what the VendingMachineEvent class would look like:</p>
<p><code><br />
package<br />
{<br />
	import flash.events.Event;</p>
<p>	public class VendingMachineEvent extends Event<br />
	{<br />
		public var snack:*;</p>
<p>		public static const RETURN_SNACK:String = "ReturnSnack";</p>
<p>		public function VendingMachineEvent(type:String, snack:*)<br />
		{<br />
			this.snack = snack;<br />
			super(type);<br />
		}<br />
	}<br />
}<br />
</code></p>
<p>and then like Andres mentioned, your receiver method:</p>
<p><code><br />
		private function getASnack(e:VendingMachineEvent):void<br />
		{<br />
			var mySnack:[what type] = e.snack;<br />
		}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-4984</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Wed, 27 Jan 2010 15:05:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4984</guid>
		<description>Dave - really,thanks for reading!  More to come.</description>
		<content:encoded><![CDATA[<p>Dave &#8211; really,thanks for reading!  More to come.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-4981</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Mon, 25 Jan 2010 06:51:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4981</guid>
		<description>Hey really, Thanks for the tutorials</description>
		<content:encoded><![CDATA[<p>Hey really, Thanks for the tutorials</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-4835</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Mon, 21 Dec 2009 21:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4835</guid>
		<description>Thanks, Robot.  We take requests.</description>
		<content:encoded><![CDATA[<p>Thanks, Robot.  We take requests.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robot</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-4829</link>
		<dc:creator>Robot</dc:creator>
		<pubDate>Sun, 20 Dec 2009 21:24:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4829</guid>
		<description>really nice tutorials, helped me alot, with a good laugh!</description>
		<content:encoded><![CDATA[<p>really nice tutorials, helped me alot, with a good laugh!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
