<?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/"
		xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
	>
<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>Fri, 10 Feb 2012 03:01:47 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ryan Henson Creighton</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-9410</link>
		<dc:creator>Ryan Henson Creighton</dc:creator>
		<pubDate>Wed, 04 Jan 2012 20:03:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-9410</guid>
		<description>Hey, Paul.  Looks like you just have an extra } at the bottom of the Change function.  Please also note that in AS3, functions/methods should not begin with a capital letter ... that&#039;s a convention they use in C# and certain other languages, but not AS3.  It won&#039;t break your code - it&#039;s just a &quot;best practices&quot; thing.</description>
		<content:encoded><![CDATA[<p>Hey, Paul.  Looks like you just have an extra } at the bottom of the Change function.  Please also note that in AS3, functions/methods should not begin with a capital letter &#8230; that&#8217;s a convention they use in C# and certain other languages, but not AS3.  It won&#8217;t break your code &#8211; it&#8217;s just a &#8220;best practices&#8221; thing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-9397</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Thu, 29 Dec 2011 07:50:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-9397</guid>
		<description>Hi Ryan

Thanks again for these EXCELLENT tutorials. I have learnt SO MUCH from them. 

In the above example that started this post, our two classes are Main and ImageGallery. In Image Gallery you have a variable numberOfImagesICanDisplay:int = 5.

When the ImageGallery Class is instantiated inside Main the Main Class can trace out the value of numberOfImagesICanDisplay showing that we can pass the value of the variable inside the ImageGallery Class to the Main Class which is instantiating it.

I tried to change the value of numberOfImagesICanDisplay fromm inside the Main Class by using (as you suggested)

imageGallery.numberOfImagesICanDisplay:int = 8;

Allthough I used a more reasonable number.

However it keeps throwing up the error;

Main.as, Line 17	1078: Label must be a simple identifier.

My code is as follows;


Inside Main.as

	public class Main extends MovieClip
	{
		public function Main()
		{
			var imageGallery:ImageGallery = new ImageGallery();
			addChild(imageGallery);
			
		}
		
		function Change ()
		{
			
			imageGallery.numberOfImagesICanDisplay:int = 8;
		}
	}
}


Inside ImageGallery.as

package
{
	import flash.display.MovieClip;
 
	public class ImageGallery extends MovieClip
	{
		public var numberOfImagesICanDisplay:int = 5;
		public function ImageGallery()
		{
			trace(numberOfImagesICanDisplay);
		}
	}
}



Any idea what the problem is ?

Thanks


Paul</description>
		<content:encoded><![CDATA[<p>Hi Ryan</p>
<p>Thanks again for these EXCELLENT tutorials. I have learnt SO MUCH from them. </p>
<p>In the above example that started this post, our two classes are Main and ImageGallery. In Image Gallery you have a variable numberOfImagesICanDisplay:int = 5.</p>
<p>When the ImageGallery Class is instantiated inside Main the Main Class can trace out the value of numberOfImagesICanDisplay showing that we can pass the value of the variable inside the ImageGallery Class to the Main Class which is instantiating it.</p>
<p>I tried to change the value of numberOfImagesICanDisplay fromm inside the Main Class by using (as you suggested)</p>
<p>imageGallery.numberOfImagesICanDisplay:int = 8;</p>
<p>Allthough I used a more reasonable number.</p>
<p>However it keeps throwing up the error;</p>
<p>Main.as, Line 17	1078: Label must be a simple identifier.</p>
<p>My code is as follows;</p>
<p>Inside Main.as</p>
<p>	public class Main extends MovieClip<br />
	{<br />
		public function Main()<br />
		{<br />
			var imageGallery:ImageGallery = new ImageGallery();<br />
			addChild(imageGallery);</p>
<p>		}</p>
<p>		function Change ()<br />
		{</p>
<p>			imageGallery.numberOfImagesICanDisplay:int = 8;<br />
		}<br />
	}<br />
}</p>
<p>Inside ImageGallery.as</p>
<p>package<br />
{<br />
	import flash.display.MovieClip;</p>
<p>	public class ImageGallery extends MovieClip<br />
	{<br />
		public var numberOfImagesICanDisplay:int = 5;<br />
		public function ImageGallery()<br />
		{<br />
			trace(numberOfImagesICanDisplay);<br />
		}<br />
	}<br />
}</p>
<p>Any idea what the problem is ?</p>
<p>Thanks</p>
<p>Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Reynolds</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-9338</link>
		<dc:creator>Ben Reynolds</dc:creator>
		<pubDate>Sat, 17 Dec 2011 03:54:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-9338</guid>
		<description>Haha, I love your writing style! Great info for new and experienced programmers alike. I find myself doing the *exact* same thing you do here with the &quot;cheaterpants&quot; method, and the occasional encapsulation when appropriate.</description>
		<content:encoded><![CDATA[<p>Haha, I love your writing style! Great info for new and experienced programmers alike. I find myself doing the *exact* same thing you do here with the &#8220;cheaterpants&#8221; method, and the occasional encapsulation when appropriate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dean Payne</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-7853</link>
		<dc:creator>Dean Payne</dc:creator>
		<pubDate>Wed, 13 Apr 2011 10:31:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-7853</guid>
		<description>I just think: Thank you for actually giving time to write tuts in the first place.</description>
		<content:encoded><![CDATA[<p>I just think: Thank you for actually giving time to write tuts in the first place.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Freddy</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-6710</link>
		<dc:creator>Freddy</dc:creator>
		<pubDate>Fri, 08 Oct 2010 15:58:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-6710</guid>
		<description>Again if you don&#039;t build a real example most will say:&quot; Oh yeah I got the idea&quot; But as soon as they will try to build a concrete example base on your vague tutorial they are lost. I am an AS3 Tutor so I know the deal. I bet half forget to link their library Class/Object they want to use and half forget to import their classes (while using several).
I mean come on what prevent you to show real examples? We are talking about 5 more lines of code at the most.</description>
		<content:encoded><![CDATA[<p>Again if you don&#8217;t build a real example most will say:&#8221; Oh yeah I got the idea&#8221; But as soon as they will try to build a concrete example base on your vague tutorial they are lost. I am an AS3 Tutor so I know the deal. I bet half forget to link their library Class/Object they want to use and half forget to import their classes (while using several).<br />
I mean come on what prevent you to show real examples? We are talking about 5 more lines of code at the most.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Henson Creighton</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-6708</link>
		<dc:creator>Ryan Henson Creighton</dc:creator>
		<pubDate>Fri, 08 Oct 2010 12:49:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-6708</guid>
		<description>Hey, Freddy. These tutorials are about &lt;em&gt;understanding&lt;/em&gt; classes, not copying and pasting someone&#039;s working code so that you don&#039;t have to put forth any effort to comprehend the material.  There&#039;s plenty of stuff online that you can copy and paste ... there are far fewer tutorials that will help you understand what you&#039;re copying and pasting.</description>
		<content:encoded><![CDATA[<p>Hey, Freddy. These tutorials are about <em>understanding</em> classes, not copying and pasting someone&#8217;s working code so that you don&#8217;t have to put forth any effort to comprehend the material.  There&#8217;s plenty of stuff online that you can copy and paste &#8230; there are far fewer tutorials that will help you understand what you&#8217;re copying and pasting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Freddy</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-6706</link>
		<dc:creator>Freddy</dc:creator>
		<pubDate>Fri, 08 Oct 2010 10:32:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-6706</guid>
		<description>Those examples are VERY confusing. You can&#039;t just through a few lines of code and expect that it will make sense. Snippet are NOT programs. If you want everybody to understand your ideas please build a REAL example not just lines of codes without any logic or base .private function getASnack(e:Event) becomes private function dispenseSnack(snack:Snack):void that does not make much sense PLEASE:).</description>
		<content:encoded><![CDATA[<p>Those examples are VERY confusing. You can&#8217;t just through a few lines of code and expect that it will make sense. Snippet are NOT programs. If you want everybody to understand your ideas please build a REAL example not just lines of codes without any logic or base .private function getASnack(e:Event) becomes private function dispenseSnack(snack:Snack):void that does not make much sense PLEASE:).</p>
]]></content:encoded>
	</item>
	<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>
	<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-4696</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Mon, 23 Nov 2009 17:35:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4696</guid>
		<description>Nils - i love the Head First series!  i have the book on C# and the one on design patterns.  i&#039;d say, though, that Kurt Vonnegut influenced me with &lt;b&gt;Breakfast of Champions&lt;/b&gt; long before i&#039;d even heard of Head First  ;)</description>
		<content:encoded><![CDATA[<p>Nils &#8211; i love the Head First series!  i have the book on C# and the one on design patterns.  i&#8217;d say, though, that Kurt Vonnegut influenced me with <b>Breakfast of Champions</b> long before i&#8217;d even heard of Head First  ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nils N.H.</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-4685</link>
		<dc:creator>Nils N.H.</dc:creator>
		<pubDate>Sun, 22 Nov 2009 18:58:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4685</guid>
		<description>Alright! I started reading the tutorials today, and I just went through them like that. The funny pictures actually DO help a lot for motivation or making my subconscious pay attention to the other information. 

Your style of writing resembles that of the Head First book series. The series boasts a philosophy of trying to make the reader &quot;care about the material like it was a tiger charging him.&quot; (Something like that)

Thanks for helping me get to grips with classes. ^^</description>
		<content:encoded><![CDATA[<p>Alright! I started reading the tutorials today, and I just went through them like that. The funny pictures actually DO help a lot for motivation or making my subconscious pay attention to the other information. </p>
<p>Your style of writing resembles that of the Head First book series. The series boasts a philosophy of trying to make the reader &#8220;care about the material like it was a tiger charging him.&#8221; (Something like that)</p>
<p>Thanks for helping me get to grips with classes. ^^</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-4475</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Tue, 27 Oct 2009 14:18:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4475</guid>
		<description>Thanks, Marcel!</description>
		<content:encoded><![CDATA[<p>Thanks, Marcel!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcel</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-4474</link>
		<dc:creator>Marcel</dc:creator>
		<pubDate>Tue, 27 Oct 2009 13:56:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4474</guid>
		<description>Thank you, learned and had fun playing with your posts!</description>
		<content:encoded><![CDATA[<p>Thank you, learned and had fun playing with your posts!</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-4403</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Mon, 12 Oct 2009 14:29:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4403</guid>
		<description>Thanks so much, Alex!  i&#039;ll definitely let you know if i write anything else that may be useful.  i have some tutorials and snippets in the &lt;b&gt;&lt;a href=&quot;http://www.untoldentertainment.com/blog/flash-and-actionscript-911/&quot; rel=&quot;nofollow&quot;&gt;Flash and Actionscript 911 book&lt;/a&gt;&lt;b&gt;.</description>
		<content:encoded><![CDATA[<p>Thanks so much, Alex!  i&#8217;ll definitely let you know if i write anything else that may be useful.  i have some tutorials and snippets in the <b><a href="http://www.untoldentertainment.com/blog/flash-and-actionscript-911/" rel="nofollow">Flash and Actionscript 911 book</a></b><b>.</b></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: axchos@yahoo.com</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-4398</link>
		<dc:creator>axchos@yahoo.com</dc:creator>
		<pubDate>Sun, 11 Oct 2009 20:49:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4398</guid>
		<description>Events can be useful when you have lots of &quot;daddies&quot; to report back to. :p

But yeah, in general I agree. I don&#039;t like to spend extra time on code organization and housekeeping when I could be actually making the game... I&#039;m still working on getting that balance right.

Also, not sure if you saw this but I included your Understanding Classes in AS3 series as one of three tutorials I recommend for getting started with AS3 game programming. (click my name for the article) Let me know if there are any other tutorials you think I should include. :)</description>
		<content:encoded><![CDATA[<p>Events can be useful when you have lots of &#8220;daddies&#8221; to report back to. :p</p>
<p>But yeah, in general I agree. I don&#8217;t like to spend extra time on code organization and housekeeping when I could be actually making the game&#8230; I&#8217;m still working on getting that balance right.</p>
<p>Also, not sure if you saw this but I included your Understanding Classes in AS3 series as one of three tutorials I recommend for getting started with AS3 game programming. (click my name for the article) Let me know if there are any other tutorials you think I should include. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Posts about Actionscript 3 as of September 25, 2009 - Perry Multimedia Blog</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-4177</link>
		<dc:creator>Posts about Actionscript 3 as of September 25, 2009 - Perry Multimedia Blog</dc:creator>
		<pubDate>Fri, 25 Sep 2009 07:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4177</guid>
		<description>[...] 3.0. Tags: flash © TipClique Tutorials , 2009. &#124; Add comment &#124; Browse all Flash Tutorials .   Tutorial – Understanding Classes in AS3 Part 4 &#8211; untoldentertainment.com 09/24/2009 In this tutorial, you’ll learn about the OOP [...]</description>
		<content:encoded><![CDATA[<p>[...] 3.0. Tags: flash © TipClique Tutorials , 2009. | Add comment | Browse all Flash Tutorials .   Tutorial – Understanding Classes in AS3 Part 4 &#8211; untoldentertainment.com 09/24/2009 In this tutorial, you’ll learn about the OOP [...]</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-4175</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Thu, 24 Sep 2009 16:22:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4175</guid>
		<description>Andres - that&#039;s an extremely helpful (and mercifully simple) explanation.  Thanks so much!</description>
		<content:encoded><![CDATA[<p>Andres &#8211; that&#8217;s an extremely helpful (and mercifully simple) explanation.  Thanks so much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andres F.</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-4174</link>
		<dc:creator>Andres F.</dc:creator>
		<pubDate>Thu, 24 Sep 2009 16:20:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4174</guid>
		<description>I&#039;ll answer for Dorian,

You create a custom Event Class for your vending machine that extends from flash.events.Event (say, VendingMachineEvent), set the constant for the event (like your RETURN_SNACK), and add a public variable with the info you want to pass (snack).

Your return snack method would look like this:

var event : VendingMachineEvent = new VendingMachineEvent(VendingMachineEvent.RETURN_SNACK);
event.snack = mySnack;
dispatchEvent(event);

Your receiver method getASnack would have (event : VendingMachineEvent ) as the parameter instead. And voila, you can call event.snack and both you and us eggheads are happy :)

You can re-use this custom event every time you need to send the same variables around. Egghead supremus would say that if the variables you want to send change, you should create a new custom event class. While I advocate that, at times it might get ridiculous (tons and TONS of slightly different events)...and truth be told, we eggheads are pragmatic, too. I&#039;ve sent that convention to hell myself a few times.

I hope that was clear enough!</description>
		<content:encoded><![CDATA[<p>I&#8217;ll answer for Dorian,</p>
<p>You create a custom Event Class for your vending machine that extends from flash.events.Event (say, VendingMachineEvent), set the constant for the event (like your RETURN_SNACK), and add a public variable with the info you want to pass (snack).</p>
<p>Your return snack method would look like this:</p>
<p>var event : VendingMachineEvent = new VendingMachineEvent(VendingMachineEvent.RETURN_SNACK);<br />
event.snack = mySnack;<br />
dispatchEvent(event);</p>
<p>Your receiver method getASnack would have (event : VendingMachineEvent ) as the parameter instead. And voila, you can call event.snack and both you and us eggheads are happy :)</p>
<p>You can re-use this custom event every time you need to send the same variables around. Egghead supremus would say that if the variables you want to send change, you should create a new custom event class. While I advocate that, at times it might get ridiculous (tons and TONS of slightly different events)&#8230;and truth be told, we eggheads are pragmatic, too. I&#8217;ve sent that convention to hell myself a few times.</p>
<p>I hope that was clear enough!</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-4173</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Thu, 24 Sep 2009 15:16:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4173</guid>
		<description>Dorian - What&#039;s your strategy for dealing with the problem of event dispatchers being unable to pass data?  Do you just use public fields?</description>
		<content:encoded><![CDATA[<p>Dorian &#8211; What&#8217;s your strategy for dealing with the problem of event dispatchers being unable to pass data?  Do you just use public fields?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dorian</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-4171</link>
		<dc:creator>Dorian</dc:creator>
		<pubDate>Thu, 24 Sep 2009 15:05:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4171</guid>
		<description>Hate the Event Model, don&#039;t hate the Dispatcha&#039;.

Custom events can be a pain, but when I finally buckle down and use them I find I see the benefits quickly more often than not.</description>
		<content:encoded><![CDATA[<p>Hate the Event Model, don&#8217;t hate the Dispatcha&#8217;.</p>
<p>Custom events can be a pain, but when I finally buckle down and use them I find I see the benefits quickly more often than not.</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-4169</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Thu, 24 Sep 2009 14:54:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4169</guid>
		<description>Merve - there&#039;s absolutely no shame in cheaterpantsing it.

Please share the series with people who are a month behind you.  Let&#039;s save each other the torment!</description>
		<content:encoded><![CDATA[<p>Merve &#8211; there&#8217;s absolutely no shame in cheaterpantsing it.</p>
<p>Please share the series with people who are a month behind you.  Let&#8217;s save each other the torment!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Merve</title>
		<link>http://www.untoldentertainment.com/blog/2009/09/24/tutorial-understanding-classes-in-as3-part-4/comment-page-1/#comment-4168</link>
		<dc:creator>Merve</dc:creator>
		<pubDate>Thu, 24 Sep 2009 14:08:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.untoldentertainment.com/blog/?p=1787#comment-4168</guid>
		<description>It&#039;s a real shame none of these articles were around a month ago when I had to learn all this stuff. 

I do everything via the cheaterpants method, mainly because I hate as3 events with a passion</description>
		<content:encoded><![CDATA[<p>It&#8217;s a real shame none of these articles were around a month ago when I had to learn all this stuff. </p>
<p>I do everything via the cheaterpants method, mainly because I hate as3 events with a passion</p>
]]></content:encoded>
	</item>
</channel>
</rss>

