<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.3" -->
<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: How to use interface in ActionScript 3</title>
	<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/</link>
	<description>Flash, ActionScript, SEO and everything in between</description>
	<pubDate>Mon, 01 Dec 2008 19:59:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>

	<item>
		<title>By: Another good use of interfaces &#124; Using interfaces when loading external swf in AS3 &#124; zedia flash blog</title>
		<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-1673</link>
		<dc:creator>Another good use of interfaces &#124; Using interfaces when loading external swf in AS3 &#124; zedia flash blog</dc:creator>
		<pubDate>Wed, 16 Apr 2008 22:13:36 +0000</pubDate>
		<guid>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-1673</guid>
		<description>[...] this year, I came to understand how to use interfaces in ActionScript 3. I used them in a particular case where polymorphism was needed but that was it since then. Last [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] this year, I came to understand how to use interfaces in ActionScript 3. I used them in a particular case where polymorphism was needed but that was it since then. Last [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: I had an epiphany as to what polymorphism is last night. at building blocks</title>
		<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-1384</link>
		<dc:creator>I had an epiphany as to what polymorphism is last night. at building blocks</dc:creator>
		<pubDate>Mon, 24 Mar 2008 03:48:23 +0000</pubDate>
		<guid>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-1384</guid>
		<description>[...] I know I am late to the party. I can't even estimate how many times I've read a definition of an Interface over the last year. It has been a concept that totally baffled me for a long time, then I sorta [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] I know I am late to the party. I can&#8217;t even estimate how many times I&#8217;ve read a definition of an Interface over the last year. It has been a concept that totally baffled me for a long time, then I sorta [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yohami</title>
		<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-28</link>
		<dc:creator>yohami</dc:creator>
		<pubDate>Thu, 03 Jan 2008 20:26:57 +0000</pubDate>
		<guid>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-28</guid>
		<description>Hi dgelineau,

Thanks. I get it. I thought the interface methods would be inherited or utilized, but they are just a template to make sure a certain class meets the standards. I will probably use it too.

Cheers,
Yohami</description>
		<content:encoded><![CDATA[<p>Hi dgelineau,</p>
<p>Thanks. I get it. I thought the interface methods would be inherited or utilized, but they are just a template to make sure a certain class meets the standards. I will probably use it too.</p>
<p>Cheers,<br />
Yohami</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dgelineau</title>
		<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-27</link>
		<dc:creator>dgelineau</dc:creator>
		<pubDate>Thu, 03 Jan 2008 05:47:14 +0000</pubDate>
		<guid>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-27</guid>
		<description>You use interfaces and polymorphism when you want to code in a way that is more maintainable. If the flash compiler is set to soft (it won't complain for type error) then you don't have to bother with that. 

But if your code is going to be used for more than one project or by more than one person, I would advise using this kind of technique. Having your compiler in strict mode is really good for catching error before they arise.

So in my case, I wanted to check if I could shoot this monster or hurt it. I had to tell the compiler which monster it was in order to use the getShoot method. In a complex game, it could have been one type of monster from a dozen type and I would have to check the current monster against each type. Instead I make sure that every monster implements the IMonster interface and because of that the compiler will throw me an error if I don't code a getShoot and canGetShoot method with the same definition as in the interface (same parameters and return type).

When I will shoot a monster, I only have to cast any monster to the IMonster type and I am sure it will have the previously mentionned methods. In time it will save me trouble, which might not be obvious at first.</description>
		<content:encoded><![CDATA[<p>You use interfaces and polymorphism when you want to code in a way that is more maintainable. If the flash compiler is set to soft (it won&#8217;t complain for type error) then you don&#8217;t have to bother with that. </p>
<p>But if your code is going to be used for more than one project or by more than one person, I would advise using this kind of technique. Having your compiler in strict mode is really good for catching error before they arise.</p>
<p>So in my case, I wanted to check if I could shoot this monster or hurt it. I had to tell the compiler which monster it was in order to use the getShoot method. In a complex game, it could have been one type of monster from a dozen type and I would have to check the current monster against each type. Instead I make sure that every monster implements the IMonster interface and because of that the compiler will throw me an error if I don&#8217;t code a getShoot and canGetShoot method with the same definition as in the interface (same parameters and return type).</p>
<p>When I will shoot a monster, I only have to cast any monster to the IMonster type and I am sure it will have the previously mentionned methods. In time it will save me trouble, which might not be obvious at first.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yohami</title>
		<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-25</link>
		<dc:creator>yohami</dc:creator>
		<pubDate>Wed, 02 Jan 2008 09:36:28 +0000</pubDate>
		<guid>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-25</guid>
		<description>Hi Zeh. How does this save time? all the methods in the interface have to be defined again on each class, right?</description>
		<content:encoded><![CDATA[<p>Hi Zeh. How does this save time? all the methods in the interface have to be defined again on each class, right?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
