<?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: How to use interface in ActionScript 3</title>
	<atom:link href="http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/</link>
	<description>Flash, ActionScript, SEO and everything in between</description>
	<lastBuildDate>Sat, 04 Feb 2012 08:16:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: encoder</title>
		<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/comment-page-1/#comment-8730</link>
		<dc:creator>encoder</dc:creator>
		<pubDate>Mon, 28 Nov 2011 12:25:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-8730</guid>
		<description>&lt;a href=&quot;#comment-25&quot; rel=&quot;nofollow&quot;&gt;@ yohami&lt;/a&gt; 

by letting you focus on architecture and not the algorithms that actually control the &quot;monster&quot; for example.</description>
		<content:encoded><![CDATA[<p><a href="#comment-25" rel="nofollow">@ yohami</a> </p>
<p>by letting you focus on architecture and not the algorithms that actually control the &#8220;monster&#8221; for example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/comment-page-1/#comment-7747</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Thu, 04 Aug 2011 02:59:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-7747</guid>
		<description>For instance

you can use in the interface

function get displayObject():DisplayObject;

in the spriteMount class

public function get displayObject():DisplayObject
{
 return this;
}

and in another class

var see:Imonster;

and then

see = new spriteMount();

and then

see.displayObject.x = 100;
see.displayObject.y = 100;</description>
		<content:encoded><![CDATA[<p>For instance</p>
<p>you can use in the interface</p>
<p>function get displayObject():DisplayObject;</p>
<p>in the spriteMount class</p>
<p>public function get displayObject():DisplayObject<br />
{<br />
 return this;<br />
}</p>
<p>and in another class</p>
<p>var see:Imonster;</p>
<p>and then</p>
<p>see = new spriteMount();</p>
<p>and then</p>
<p>see.displayObject.x = 100;<br />
see.displayObject.y = 100;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steve</title>
		<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/comment-page-1/#comment-7191</link>
		<dc:creator>steve</dc:creator>
		<pubDate>Wed, 15 Jun 2011 23:17:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-7191</guid>
		<description>I&#039;m building a game with this sort of class hierarchy:

Class Entity extends Sprite
    Class Player extends Entity
    Class Platform extends Entity
    Class Monster extends Entity

These are the main classes, but within class player and class monster I have a reference for a settings object:

Interface EntitySetting
    public get...set...
    public methods....
    abstract methods... (implemented by specific child class)
         Class MonsterSetting implements EntitySetting
         Class PlayerSetting implements EntitySetting
         Class PlatformSetting implements EntitySetting
So in the Specific class settings objects, each using the function headers from the EntitySetting class.

So then I can just have an array of Entity objects in my main game driver class. You can easily perform operations on all objects at once by calling them all Entities, then any specific code will filter through their Settings object. If it is Melee dps monster or a ranged caster monster, or a tall platform, short platform with spikes, w/e.</description>
		<content:encoded><![CDATA[<p>I&#8217;m building a game with this sort of class hierarchy:</p>
<p>Class Entity extends Sprite<br />
    Class Player extends Entity<br />
    Class Platform extends Entity<br />
    Class Monster extends Entity</p>
<p>These are the main classes, but within class player and class monster I have a reference for a settings object:</p>
<p>Interface EntitySetting<br />
    public get&#8230;set&#8230;<br />
    public methods&#8230;.<br />
    abstract methods&#8230; (implemented by specific child class)<br />
         Class MonsterSetting implements EntitySetting<br />
         Class PlayerSetting implements EntitySetting<br />
         Class PlatformSetting implements EntitySetting<br />
So in the Specific class settings objects, each using the function headers from the EntitySetting class.</p>
<p>So then I can just have an array of Entity objects in my main game driver class. You can easily perform operations on all objects at once by calling them all Entities, then any specific code will filter through their Settings object. If it is Melee dps monster or a ranged caster monster, or a tall platform, short platform with spikes, w/e.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/comment-page-1/#comment-7122</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Mon, 06 Jun 2011 14:27:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-7122</guid>
		<description>&lt;a href=&quot;#comment-25&quot; rel=&quot;nofollow&quot;&gt;@ yohami&lt;/a&gt; 
In addition, this will allow your code to be dynamic down the road. Think of an interface as a way of building functions that can be variable within a class. If you create an interface, then you can create several classes that implement that interface. In this way, those classes define a behavior (functionality) described in the interface. Then you can create an instance of these classes within your main object, and change it over time to basic render all the functions within the interface as &#039;variable&#039; functions.

The short and easy description is that using interfaces allows you to add dynamic behavior (functionality) to your classes, as opposed to hard coding it.</description>
		<content:encoded><![CDATA[<p><a href="#comment-25" rel="nofollow">@ yohami</a><br />
In addition, this will allow your code to be dynamic down the road. Think of an interface as a way of building functions that can be variable within a class. If you create an interface, then you can create several classes that implement that interface. In this way, those classes define a behavior (functionality) described in the interface. Then you can create an instance of these classes within your main object, and change it over time to basic render all the functions within the interface as &#8216;variable&#8217; functions.</p>
<p>The short and easy description is that using interfaces allows you to add dynamic behavior (functionality) to your classes, as opposed to hard coding it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: max</title>
		<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/comment-page-1/#comment-5916</link>
		<dc:creator>max</dc:creator>
		<pubDate>Wed, 19 Jan 2011 01:28:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-5916</guid>
		<description>For those struggling about the fact that once an interface is implemented you lose for example the displayobject inheritance (because you cannot extend your interface to a class,) .. the solution is the other way around... you shouldn&#039;t cast to a displayobject but have your object already as displayobject and then eventually cast to your interface when you need specifc stuff from there (isn&#039;t that the meaning of an interface.. ;-)). If I have a base class Page (which may or may not implement an interface) but for sure will extend a displayobject and other subpages like Homepage, Contactpage and so on which implement an interface.. when I create an Homepage instance I create it as a Page(displayobject) so I can move it, attach listerners and add it to stage.. only when I need to call a specific method from the interface I cast it to the interface and for example call an initPage() ...</description>
		<content:encoded><![CDATA[<p>For those struggling about the fact that once an interface is implemented you lose for example the displayobject inheritance (because you cannot extend your interface to a class,) .. the solution is the other way around&#8230; you shouldn&#8217;t cast to a displayobject but have your object already as displayobject and then eventually cast to your interface when you need specifc stuff from there (isn&#8217;t that the meaning of an interface.. <img src='http://www.zedia.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ). If I have a base class Page (which may or may not implement an interface) but for sure will extend a displayobject and other subpages like Homepage, Contactpage and so on which implement an interface.. when I create an Homepage instance I create it as a Page(displayobject) so I can move it, attach listerners and add it to stage.. only when I need to call a specific method from the interface I cast it to the interface and for example call an initPage() &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jack</title>
		<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/comment-page-1/#comment-5905</link>
		<dc:creator>jack</dc:creator>
		<pubDate>Mon, 17 Jan 2011 17:01:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-5905</guid>
		<description>&lt;a href=&quot;#comment-3942&quot; rel=&quot;nofollow&quot;&gt;@ brecht&lt;/a&gt; 

But still what?</description>
		<content:encoded><![CDATA[<p><a href="#comment-3942" rel="nofollow">@ brecht</a> </p>
<p>But still what?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: asciiman</title>
		<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/comment-page-1/#comment-5731</link>
		<dc:creator>asciiman</dc:creator>
		<pubDate>Fri, 17 Dec 2010 19:42:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-5731</guid>
		<description>@northmantif
An interface is a signature, while if you extend from a Fruit class you must actually implement the fruit class.  How would you implement the getVitamins() function for a Fruit?  You can&#039;t, because generic fruits don&#039;t have vitamins.  A generic fruit is just a generalization, not actually real.

So interfaces are good for when you need to generalize something that is in common with multiple real things, and you want to create a binding signature for those things.</description>
		<content:encoded><![CDATA[<p>@northmantif<br />
An interface is a signature, while if you extend from a Fruit class you must actually implement the fruit class.  How would you implement the getVitamins() function for a Fruit?  You can&#8217;t, because generic fruits don&#8217;t have vitamins.  A generic fruit is just a generalization, not actually real.</p>
<p>So interfaces are good for when you need to generalize something that is in common with multiple real things, and you want to create a binding signature for those things.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: northmantif</title>
		<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/comment-page-1/#comment-5646</link>
		<dc:creator>northmantif</dc:creator>
		<pubDate>Mon, 06 Dec 2010 10:34:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-5646</guid>
		<description>and what&#039;s the difference between making an Interface, and extending class from a Fruit class i.e. like in the example above, but to pass to the:
function DisplayFruitVitamins(fruit:Fruit):void
{
displayedtext_.Text=fruit.getVitamins ():
}

DisplayFruitVitamins(banana);
??</description>
		<content:encoded><![CDATA[<p>and what&#8217;s the difference between making an Interface, and extending class from a Fruit class i.e. like in the example above, but to pass to the:<br />
function DisplayFruitVitamins(fruit:Fruit):void<br />
{<br />
displayedtext_.Text=fruit.getVitamins ():<br />
}</p>
<p>DisplayFruitVitamins(banana);<br />
??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Quakeboy</title>
		<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/comment-page-1/#comment-5604</link>
		<dc:creator>Quakeboy</dc:creator>
		<pubDate>Wed, 24 Nov 2010 17:00:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-5604</guid>
		<description>Thanks for the quick tutorial.. apt length and to the point explanations.</description>
		<content:encoded><![CDATA[<p>Thanks for the quick tutorial.. apt length and to the point explanations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/comment-page-1/#comment-5399</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Sat, 28 Aug 2010 15:30:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/2008/how-to-use-interface-in-actionscript-3/#comment-5399</guid>
		<description>Hehe, it&#039;s this short intros that saves the average AS3 starter a lot og &quot;head against the wall/desk&quot; time.</description>
		<content:encoded><![CDATA[<p>Hehe, it&#8217;s this short intros that saves the average AS3 starter a lot og &#8220;head against the wall/desk&#8221; time.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

