<?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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
	>
<channel>
	<title>Comments on: ActionScript 4 feature request: interfaces with events</title>
	<atom:link href="http://aralbalkan.com/772/feed" rel="self" type="application/rss+xml" />
	<link>http://aralbalkan.com/772</link>
	<description>Passionate geekisms.</description>
	<lastBuildDate>Fri, 19 Mar 2010 19:46:31 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Darren S.</title>
		<link>http://aralbalkan.com/772/comment-page-1#comment-258823</link>
		<dc:creator>Darren S.</dc:creator>
		<pubDate>Tue, 08 Dec 2009 20:22:32 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/772#comment-258823</guid>
		<description>Just a follow up: I was inspired to come up with a solution to this problem so I&#039;ve created a few classes and interfaces that will hopefully make specifying events on an interface a little easier.

See my post here on my blog: http://gamesandtech.wordpress.com/2009/10/14/actionscript-3-specifying-events-on-interfaces/</description>
		<content:encoded><![CDATA[<p>Just a follow up: I was inspired to come up with a solution to this problem so I&#8217;ve created a few classes and interfaces that will hopefully make specifying events on an interface a little easier.</p>
<p>See my post here on my blog: <a href="http://gamesandtech.wordpress.com/2009/10/14/actionscript-3-specifying-events-on-interfaces/" rel="nofollow">http://gamesandtech.wordpress.com/2009/10/14/actionscript-3-specifying-events-on-interfaces/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juan P. Reyes</title>
		<link>http://aralbalkan.com/772/comment-page-1#comment-258772</link>
		<dc:creator>Juan P. Reyes</dc:creator>
		<pubDate>Thu, 26 Nov 2009 22:48:40 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/772#comment-258772</guid>
		<description>Totally agree! One may want to be sure that an implementation dispatches certain events.</description>
		<content:encoded><![CDATA[<p>Totally agree! One may want to be sure that an implementation dispatches certain events.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darren S.</title>
		<link>http://aralbalkan.com/772/comment-page-1#comment-258084</link>
		<dc:creator>Darren S.</dc:creator>
		<pubDate>Tue, 13 Oct 2009 23:09:36 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/772#comment-258084</guid>
		<description>Just thought I&#039;d share some insight on the situation a bit. I&#039;ve been developing interfaces in AS3 for years now, it&#039;s where I like to start with a class. One thing you&#039;ll notice is that interfaces cannot extend from classes. That is to say:


public class MyClass { ... }
public interface MyInterface extends MyClass { ... }


Will not compile (which is to be expected). However, interfaces can extend other interfaces, in fact, interfaces can extend any number of interfaces.


public interface MyBaseInterface { ... }
public interface MyInterface extends IEventDispatcher, MyBaseInterface { ... }


So the trick to get your interfaces to have the add/remove even listener methods is rather easy. The trick is to specify which events are part of the interface contract, which is not supported by the language at the moment. Perhaps someone can come up with an approach using Filipe&#039;s method of specifying events at the class level combining interface inheritance.

I myself enjoy the C# approach to events, in fact I wish Actionscript were C# to tell you the truth. I enjoy C# far more than I do AS3, however I enjoy the display list approach Adobe has taken in the Flash world.</description>
		<content:encoded><![CDATA[<p>Just thought I&#8217;d share some insight on the situation a bit. I&#8217;ve been developing interfaces in AS3 for years now, it&#8217;s where I like to start with a class. One thing you&#8217;ll notice is that interfaces cannot extend from classes. That is to say:</p>
<p>public class MyClass { &#8230; }<br />
public interface MyInterface extends MyClass { &#8230; }</p>
<p>Will not compile (which is to be expected). However, interfaces can extend other interfaces, in fact, interfaces can extend any number of interfaces.</p>
<p>public interface MyBaseInterface { &#8230; }<br />
public interface MyInterface extends IEventDispatcher, MyBaseInterface { &#8230; }</p>
<p>So the trick to get your interfaces to have the add/remove even listener methods is rather easy. The trick is to specify which events are part of the interface contract, which is not supported by the language at the moment. Perhaps someone can come up with an approach using Filipe&#8217;s method of specifying events at the class level combining interface inheritance.</p>
<p>I myself enjoy the C# approach to events, in fact I wish Actionscript were C# to tell you the truth. I enjoy C# far more than I do AS3, however I enjoy the display list approach Adobe has taken in the Flash world.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Florian Salihovic</title>
		<link>http://aralbalkan.com/772/comment-page-1#comment-257869</link>
		<dc:creator>Florian Salihovic</dc:creator>
		<pubDate>Fri, 18 Sep 2009 18:26:05 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/772#comment-257869</guid>
		<description>I think that&#039;s what the metadata is meant to be for?</description>
		<content:encoded><![CDATA[<p>I think that&#8217;s what the metadata is meant to be for?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Filipe</title>
		<link>http://aralbalkan.com/772/comment-page-1#comment-256075</link>
		<dc:creator>Filipe</dc:creator>
		<pubDate>Wed, 27 May 2009 17:14:25 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/772#comment-256075</guid>
		<description>Hi,

I&#039;d suggest C# event handling ...

But for now, when I need an interface to define events, I do something like this:

interface ISomeLoader {
        function addProgressListener(listener:Function,[whatever]):void;
        function removeProgressListener(listener:Function):void;
}
class SomeLoader implements ISomeLoader {
       public function addProgressListener(listener:Function,[whatever]):void{
               this.addEventListener(MyEvent.PROGRESS, listener);
       }
       public function removeProgressListener(listener:Function):void{
               this.removeEventListener(MyEvent.PROGRESS, listener);
       }
}

This doesn&#039;t define the type of event, I specify it in the comments.

Anyway this works fine for me and makes it easier to write the class clients.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;d suggest C# event handling &#8230;</p>
<p>But for now, when I need an interface to define events, I do something like this:</p>
<p>interface ISomeLoader {<br />
        function addProgressListener(listener:Function,[whatever]):void;<br />
        function removeProgressListener(listener:Function):void;<br />
}<br />
class SomeLoader implements ISomeLoader {<br />
       public function addProgressListener(listener:Function,[whatever]):void{<br />
               this.addEventListener(MyEvent.PROGRESS, listener);<br />
       }<br />
       public function removeProgressListener(listener:Function):void{<br />
               this.removeEventListener(MyEvent.PROGRESS, listener);<br />
       }<br />
}</p>
<p>This doesn&#8217;t define the type of event, I specify it in the comments.</p>
<p>Anyway this works fine for me and makes it easier to write the class clients.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mario Ruggier</title>
		<link>http://aralbalkan.com/772/comment-page-1#comment-249191</link>
		<dc:creator>Mario Ruggier</dc:creator>
		<pubDate>Mon, 27 Apr 2009 10:46:18 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/772#comment-249191</guid>
		<description>But, if as you suggest AS interfaces were to support declaring events (on the class level) with:

    event progress:ProgressEvent;

Wouldn&#039;t you, in a similar fashion, also want to be able to declare styles, e.g.

    style doingGoodProgressEffect:SomeStyleType;

But... a problem of AS abd Flex, imho, is the infiltration of so many keywords and concepts. It may be too late, but shouldn&#039;t AS aim at simplification rather than continued keyword/concept creep?

On the other hand, is there a particular reason why AS interfaces do not support declaration of (public) vars, instead of only supporting get/set properties? 

My gut feeling is that a more generic way to proceed would be to 
a) adjust how events/styles (or anything currently requiring decoration via &quot;metadata&quot; declaration) in Flex are declared, such that they are instead declared via vars/properties of a given type
b) add support for var declaration to AS interfaces

The alternative i.e. that of adding the possibility for AS interfaces to support class/method metada decorations, might well be feasible but I suspect my hide numerous issues that may dirty the approach...</description>
		<content:encoded><![CDATA[<p>But, if as you suggest AS interfaces were to support declaring events (on the class level) with:</p>
<p>    event progress:ProgressEvent;</p>
<p>Wouldn&#8217;t you, in a similar fashion, also want to be able to declare styles, e.g.</p>
<p>    style doingGoodProgressEffect:SomeStyleType;</p>
<p>But&#8230; a problem of AS abd Flex, imho, is the infiltration of so many keywords and concepts. It may be too late, but shouldn&#8217;t AS aim at simplification rather than continued keyword/concept creep?</p>
<p>On the other hand, is there a particular reason why AS interfaces do not support declaration of (public) vars, instead of only supporting get/set properties? </p>
<p>My gut feeling is that a more generic way to proceed would be to<br />
a) adjust how events/styles (or anything currently requiring decoration via &#8220;metadata&#8221; declaration) in Flex are declared, such that they are instead declared via vars/properties of a given type<br />
b) add support for var declaration to AS interfaces</p>
<p>The alternative i.e. that of adding the possibility for AS interfaces to support class/method metada decorations, might well be feasible but I suspect my hide numerous issues that may dirty the approach&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Huw Collingbourne</title>
		<link>http://aralbalkan.com/772/comment-page-1#comment-245923</link>
		<dc:creator>Huw Collingbourne</dc:creator>
		<pubDate>Wed, 15 Apr 2009 21:32:12 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/772#comment-245923</guid>
		<description>@Darkrider said: &quot;the reason Silver light is going to seriously hurt Flash and Flex isn’t because of the effectiveness of Action Script… it’s because of simple tools inside the Silver Light/Blend Visual Studio Development platforms&quot;

Please let me introduce you to Amethyst :-)

This is a Visual Studio Flex IDE from my company, SapphireSteel Software. It will have a full suite of Visual Studio tools for coding,, design, debugging etc. We will release two editions - a free &#039;Personal Edition&#039; and a commercial &#039;Professional&#039; edition. Amethyst is already available in beta and version 1.0 will be released in a few months.

Both editions have IntelliSense, code formatting/colouring/folding, debugging with drill-down etc. Amethyst Professional will also have a drag-and-drop visual designer for Flex/AIR (Flex 3 md 4) plus enhanced debugging (tracepoints, conditional breakpoints etc.) - all seamlessly integrated into Visual Studio.

More info on our web site. The blog is a good place to start: http://www.sapphiresteel.com/-Blog-

best wishes
Huw</description>
		<content:encoded><![CDATA[<p>@Darkrider said: &#8220;the reason Silver light is going to seriously hurt Flash and Flex isn’t because of the effectiveness of Action Script… it’s because of simple tools inside the Silver Light/Blend Visual Studio Development platforms&#8221;</p>
<p>Please let me introduce you to Amethyst :-)</p>
<p>This is a Visual Studio Flex IDE from my company, SapphireSteel Software. It will have a full suite of Visual Studio tools for coding,, design, debugging etc. We will release two editions &#8211; a free &#8216;Personal Edition&#8217; and a commercial &#8216;Professional&#8217; edition. Amethyst is already available in beta and version 1.0 will be released in a few months.</p>
<p>Both editions have IntelliSense, code formatting/colouring/folding, debugging with drill-down etc. Amethyst Professional will also have a drag-and-drop visual designer for Flex/AIR (Flex 3 md 4) plus enhanced debugging (tracepoints, conditional breakpoints etc.) &#8211; all seamlessly integrated into Visual Studio.</p>
<p>More info on our web site. The blog is a good place to start: <a href="http://www.sapphiresteel.com/-Blog-" rel="nofollow">http://www.sapphiresteel.com/-Blog-</a></p>
<p>best wishes<br />
Huw</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to Get Six Pack Fast</title>
		<link>http://aralbalkan.com/772/comment-page-1#comment-245845</link>
		<dc:creator>How to Get Six Pack Fast</dc:creator>
		<pubDate>Wed, 15 Apr 2009 14:48:16 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/772#comment-245845</guid>
		<description>The style of writing is quite familiar to me. Have you written guest posts for other bloggers?</description>
		<content:encoded><![CDATA[<p>The style of writing is quite familiar to me. Have you written guest posts for other bloggers?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jomoja</title>
		<link>http://aralbalkan.com/772/comment-page-1#comment-244845</link>
		<dc:creator>jomoja</dc:creator>
		<pubDate>Sun, 12 Apr 2009 12:56:16 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/772#comment-244845</guid>
		<description>Casting as Sprite instances of interfaces that extend Sprite seems to work for adding listeners, e.g.:

class MyClass extends Sprite implements IMyInterface

// when using MyClass from client, cast instance as Sprite (which MyClass extends) to access built-in Sprite methods like addEventListener

var myobj:IMyInterface;
myobj = new MyClass();
Sprite(MyClass).addEventListener(...</description>
		<content:encoded><![CDATA[<p>Casting as Sprite instances of interfaces that extend Sprite seems to work for adding listeners, e.g.:</p>
<p>class MyClass extends Sprite implements IMyInterface</p>
<p>// when using MyClass from client, cast instance as Sprite (which MyClass extends) to access built-in Sprite methods like addEventListener</p>
<p>var myobj:IMyInterface;<br />
myobj = new MyClass();<br />
Sprite(MyClass).addEventListener(&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://aralbalkan.com/772/comment-page-1#comment-232660</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Thu, 19 Mar 2009 10:48:37 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/772#comment-232660</guid>
		<description>I agree with you that there should be some way to specify that a class should dispatch certain events.  Maybe it might be better to use a different word than &#039;interface&#039; though, just to avoid tying the concepts together for now.

So it could be something like

class SomeClass extends SomeBase implements ISomeInterface dispatches SomeNewFancyThing
{ ... }</description>
		<content:encoded><![CDATA[<p>I agree with you that there should be some way to specify that a class should dispatch certain events.  Maybe it might be better to use a different word than &#8216;interface&#8217; though, just to avoid tying the concepts together for now.</p>
<p>So it could be something like</p>
<p>class SomeClass extends SomeBase implements ISomeInterface dispatches SomeNewFancyThing<br />
{ &#8230; }</p>
]]></content:encoded>
	</item>
</channel>
</rss>
