<?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: Introducing TurboSignals</title>
	<atom:link href="http://jacksondunstan.com/articles/585/feed" rel="self" type="application/rss+xml" />
	<link>http://jacksondunstan.com/articles/585</link>
	<description>Mastering AS3</description>
	<lastBuildDate>Mon, 14 May 2012 17:02:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/585/comment-page-1#comment-26235</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Sat, 07 Apr 2012 21:49:43 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=585#comment-26235</guid>
		<description>No problem; I&#039;m happy to help. :)

One more thought on the subject: you could separate your classes even further by using an interface. For example:

&lt;pre lang=&quot;actionscript3&quot;&gt;
// Abstracts the class that emits the click signal
interface Clickable
{
    function get click(): Signal0;
}

// Same button as above, but now implementing the Clickable interface
class ButtonTS implements Clickable
{
    private const __click:Signal0 = new Signal0();
    public function get click(): Signal0
    {
        return __click;
    }
    private function someFunction(): void
    {
        __click.dispatch();
    }
}

// Code that uses a Clickable instead of ButtonTS directly
function listenForClicks(clicker:Clickable): void
{
    clicker.click.addSlot(new FunctionSlot0(onClick));
}
&lt;/pre&gt;

This is a lot harder and messier than with &lt;code&gt;EventDispatcher&lt;/code&gt; since classes using that approach don&#039;t have any strongly-typed definition of what events they dispatch. I&#039;ll leave it up to you to think about how you&#039;d even go about making an interface like &lt;code&gt;Clickable&lt;/code&gt; with the &lt;code&gt;EventDispatcher&lt;/code&gt; system. :)</description>
		<content:encoded><![CDATA[<p>No problem; I&#8217;m happy to help. :)</p>
<p>One more thought on the subject: you could separate your classes even further by using an interface. For example:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// Abstracts the class that emits the click signal</span>
interface Clickable
<span style="color: #000000;">&#123;</span>
    <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> <span style="color: #004993;">click</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span> Signal0<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// Same button as above, but now implementing the Clickable interface</span>
<span style="color: #9900cc; font-weight: bold;">class</span> ButtonTS implements Clickable
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">private</span> const __click<span style="color: #000066; font-weight: bold;">:</span>Signal0 = <span style="color: #0033ff; font-weight: bold;">new</span> Signal0<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> <span style="color: #004993;">click</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span> Signal0
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0033ff; font-weight: bold;">return</span> __click<span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> someFunction<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span>
    <span style="color: #000000;">&#123;</span>
        __click<span style="color: #000066; font-weight: bold;">.</span>dispatch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// Code that uses a Clickable instead of ButtonTS directly</span>
<span style="color: #339966; font-weight: bold;">function</span> listenForClicks<span style="color: #000000;">&#40;</span>clicker<span style="color: #000066; font-weight: bold;">:</span>Clickable<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
    clicker<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">click</span><span style="color: #000066; font-weight: bold;">.</span>addSlot<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> FunctionSlot0<span style="color: #000000;">&#40;</span>onClick<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>This is a lot harder and messier than with <code>EventDispatcher</code> since classes using that approach don&#8217;t have any strongly-typed definition of what events they dispatch. I&#8217;ll leave it up to you to think about how you&#8217;d even go about making an interface like <code>Clickable</code> with the <code>EventDispatcher</code> system. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: whattatorpe</title>
		<link>http://jacksondunstan.com/articles/585/comment-page-1#comment-26206</link>
		<dc:creator>whattatorpe</dc:creator>
		<pubDate>Sat, 07 Apr 2012 10:44:57 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=585#comment-26206</guid>
		<description>A year-old thread and I get an answer the same day... I don&#039;t know how to say how awsome I find this. Danke!!

I think you undestood my question even better than I did. After a while fiddling both with ED and TS, yep, code is moved a bit here and there, but as long as you don&#039;t rely on event bubbling things don&#039;t change that much.

I guess that when I saw that public variables had to be declared, it came to my mind all this things actual programmers say about how bad dependencies are for encapsulation and so, but after a while dealing with your code I think I&#039;m rather uninformed on the subject.

Thanks again for sharing your knowledge.</description>
		<content:encoded><![CDATA[<p>A year-old thread and I get an answer the same day&#8230; I don&#8217;t know how to say how awsome I find this. Danke!!</p>
<p>I think you undestood my question even better than I did. After a while fiddling both with ED and TS, yep, code is moved a bit here and there, but as long as you don&#8217;t rely on event bubbling things don&#8217;t change that much.</p>
<p>I guess that when I saw that public variables had to be declared, it came to my mind all this things actual programmers say about how bad dependencies are for encapsulation and so, but after a while dealing with your code I think I&#8217;m rather uninformed on the subject.</p>
<p>Thanks again for sharing your knowledge.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/585/comment-page-1#comment-26120</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Fri, 06 Apr 2012 02:53:28 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=585#comment-26120</guid>
		<description>Thanks for the kind words about the site. The way I see it, there is only one major stylistic difference between TurboSignals and &lt;code&gt;EventDispatcher&lt;/code&gt;: TurboSignals does not use &lt;code&gt;String&lt;/code&gt; event names. Consider these two simple classes:

&lt;pre lang=&quot;actionscript3&quot;&gt;
class ButtonED extends EventDispatcher
{
    private function someFunction(): void
    {
        dispatchEvent(new Event(&quot;mouseDown&quot;));
        // or...
        dispatchEvent(new Event(&quot;mouseUp&quot;));
    }
}
class ButtonTS
{
    public const mouseDown:Signal0 = new Signal0();
    public const mouseUp:Signal0 = new Signal0();
    private function someFunction(): void
    {
        mouseDown.dispatch();
        // or...
        mouseUp.dispatch();
    }
}
&lt;/pre&gt;

And some code that uses them:

&lt;pre lang=&quot;actionscript3&quot;&gt;
var buttonED:ButtonED = new ButtonED();
buttonED.addEventListener(&quot;mouseDown&quot;, onMouseDown);
buttonED.addEventListener(&quot;mouseUp&quot;, onMouseUp);

var buttonTS:ButtonTS = new ButtonTS();
buttonTS.mouseDown.addSlot(new FunctionSlot0(onMouseDown));
buttonTS.mouseUp.addSlot(new FunctionSlot0(onMouseUp));
&lt;/pre&gt;

If I understand your question correctly, you&#039;re wondering about how the user will change when the button changes. Say the two events are replaced by a single &quot;click&quot; event. Here&#039;s what the button classes would look like:

&lt;pre lang=&quot;actionscript3&quot;&gt;
class ButtonED extends EventDispatcher
{
    private function someFunction(): void
    {
        dispatchEvent(new Event(&quot;click&quot;));
    }
}
class ButtonTS
{
    public const click:Signal0 = new Signal0();
    private function someFunction(): void
    {
        click.dispatch();
    }
}
&lt;/pre&gt;

And here&#039;s the user code:

&lt;pre lang=&quot;actionscript3&quot;&gt;
var buttonED:ButtonED = new ButtonED();
buttonED.addEventListener(&quot;click&quot;, onClick);

var buttonTS:ButtonTS = new ButtonTS();
buttonTS.click.addSlot(new FunctionSlot0(onClick));
&lt;/pre&gt;

To me, it&#039;s about the same level of maintenance required by both versions.</description>
		<content:encoded><![CDATA[<p>Thanks for the kind words about the site. The way I see it, there is only one major stylistic difference between TurboSignals and <code>EventDispatcher</code>: TurboSignals does not use <code>String</code> event names. Consider these two simple classes:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">class</span> ButtonED <span style="color: #0033ff; font-weight: bold;">extends</span> <span style="color: #004993;">EventDispatcher</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> someFunction<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Event</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;mouseDown&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #009900; font-style: italic;">// or...</span>
        <span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Event</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;mouseUp&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #9900cc; font-weight: bold;">class</span> ButtonTS
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">public</span> const <span style="color: #004993;">mouseDown</span><span style="color: #000066; font-weight: bold;">:</span>Signal0 = <span style="color: #0033ff; font-weight: bold;">new</span> Signal0<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">public</span> const <span style="color: #004993;">mouseUp</span><span style="color: #000066; font-weight: bold;">:</span>Signal0 = <span style="color: #0033ff; font-weight: bold;">new</span> Signal0<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> someFunction<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #004993;">mouseDown</span><span style="color: #000066; font-weight: bold;">.</span>dispatch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #009900; font-style: italic;">// or...</span>
        <span style="color: #004993;">mouseUp</span><span style="color: #000066; font-weight: bold;">.</span>dispatch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>And some code that uses them:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> buttonED<span style="color: #000066; font-weight: bold;">:</span>ButtonED = <span style="color: #0033ff; font-weight: bold;">new</span> ButtonED<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
buttonED<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;mouseDown&quot;</span><span style="color: #000066; font-weight: bold;">,</span> onMouseDown<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
buttonED<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;mouseUp&quot;</span><span style="color: #000066; font-weight: bold;">,</span> onMouseUp<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> buttonTS<span style="color: #000066; font-weight: bold;">:</span>ButtonTS = <span style="color: #0033ff; font-weight: bold;">new</span> ButtonTS<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
buttonTS<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">mouseDown</span><span style="color: #000066; font-weight: bold;">.</span>addSlot<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> FunctionSlot0<span style="color: #000000;">&#40;</span>onMouseDown<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
buttonTS<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">mouseUp</span><span style="color: #000066; font-weight: bold;">.</span>addSlot<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> FunctionSlot0<span style="color: #000000;">&#40;</span>onMouseUp<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>If I understand your question correctly, you&#8217;re wondering about how the user will change when the button changes. Say the two events are replaced by a single &#8220;click&#8221; event. Here&#8217;s what the button classes would look like:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">class</span> ButtonED <span style="color: #0033ff; font-weight: bold;">extends</span> <span style="color: #004993;">EventDispatcher</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> someFunction<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Event</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;click&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #9900cc; font-weight: bold;">class</span> ButtonTS
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">public</span> const <span style="color: #004993;">click</span><span style="color: #000066; font-weight: bold;">:</span>Signal0 = <span style="color: #0033ff; font-weight: bold;">new</span> Signal0<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> someFunction<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #004993;">click</span><span style="color: #000066; font-weight: bold;">.</span>dispatch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>And here&#8217;s the user code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> buttonED<span style="color: #000066; font-weight: bold;">:</span>ButtonED = <span style="color: #0033ff; font-weight: bold;">new</span> ButtonED<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
buttonED<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;click&quot;</span><span style="color: #000066; font-weight: bold;">,</span> onClick<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> buttonTS<span style="color: #000066; font-weight: bold;">:</span>ButtonTS = <span style="color: #0033ff; font-weight: bold;">new</span> ButtonTS<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
buttonTS<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">click</span><span style="color: #000066; font-weight: bold;">.</span>addSlot<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> FunctionSlot0<span style="color: #000000;">&#40;</span>onClick<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>To me, it&#8217;s about the same level of maintenance required by both versions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: whattatorpe</title>
		<link>http://jacksondunstan.com/articles/585/comment-page-1#comment-26090</link>
		<dc:creator>whattatorpe</dc:creator>
		<pubDate>Thu, 05 Apr 2012 14:25:41 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=585#comment-26090</guid>
		<description>One year old thread... well, I&#039;ll try anyways...

I&#039;m not a hardcore programmer, so maybe my question is kind of illiterate:
This way Turbosignals or Signals work, isn&#039;t all this against encapsulation?
 
Let&#039;s picture a menu and a menuButton for folding or unfolding it.

I use the flash IDE events (addEventListener, dispatchEvent... you&#039;ll know better) and doing so, menuButton need no public vars and I can reuse it everywhere, as long as I add addEventListener (custom_event).  I can reuse it in other projects, classes, clips on the stage, and if I remove it or simply don&#039;t use it, I don&#039;t need to make any changes in the code besides removing  new:menuButton 

But using Turbosignals I cannot move my menuButton between classes or even different projects, I have first to implement access to every public var:Turbosigna in menuButtnl, or, if I later regret, I end up with a lot of referenceless variables I have to deal with.

Is it that I&#039;m missing something, or, to say it clearly, the problem is that I do need serious programming tuition?

Anyways, as far as the parts I&#039;m able to understand, great blog</description>
		<content:encoded><![CDATA[<p>One year old thread&#8230; well, I&#8217;ll try anyways&#8230;</p>
<p>I&#8217;m not a hardcore programmer, so maybe my question is kind of illiterate:<br />
This way Turbosignals or Signals work, isn&#8217;t all this against encapsulation?</p>
<p>Let&#8217;s picture a menu and a menuButton for folding or unfolding it.</p>
<p>I use the flash IDE events (addEventListener, dispatchEvent&#8230; you&#8217;ll know better) and doing so, menuButton need no public vars and I can reuse it everywhere, as long as I add addEventListener (custom_event).  I can reuse it in other projects, classes, clips on the stage, and if I remove it or simply don&#8217;t use it, I don&#8217;t need to make any changes in the code besides removing  new:menuButton </p>
<p>But using Turbosignals I cannot move my menuButton between classes or even different projects, I have first to implement access to every public var:Turbosigna in menuButtnl, or, if I later regret, I end up with a lot of referenceless variables I have to deal with.</p>
<p>Is it that I&#8217;m missing something, or, to say it clearly, the problem is that I do need serious programming tuition?</p>
<p>Anyways, as far as the parts I&#8217;m able to understand, great blog</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://jacksondunstan.com/articles/585/comment-page-1#comment-4171</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Wed, 23 Feb 2011 23:13:18 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=585#comment-4171</guid>
		<description>I am still using the FunctionSlot and the dispatch function still calls the function from the interface. I think removing the slots now is more simple, since the example does not show how to remove slots. Do you this this is slower? Sorry if i removed the turbo from the signal :) I think these signals are more readable then CustomEvents anyway, I am starting to like the idea of this lightweight event alternative.</description>
		<content:encoded><![CDATA[<p>I am still using the FunctionSlot and the dispatch function still calls the function from the interface. I think removing the slots now is more simple, since the example does not show how to remove slots. Do you this this is slower? Sorry if i removed the turbo from the signal :) I think these signals are more readable then CustomEvents anyway, I am starting to like the idea of this lightweight event alternative.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/585/comment-page-1#comment-4170</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Wed, 23 Feb 2011 22:43:41 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=585#comment-4170</guid>
		<description>TurboSignals is meant as a fast alternative to &lt;code&gt;EventDispatcher&lt;/code&gt; and as3signals. If you&#039;re going to use &lt;code&gt;Function&lt;/code&gt; objects directly, you&#039;ve given up most of the speed advantages. If speed is not your goal, consider &lt;code&gt;EventDispatcher&lt;/code&gt; or as3signals instead.</description>
		<content:encoded><![CDATA[<p>TurboSignals is meant as a fast alternative to <code>EventDispatcher</code> and as3signals. If you&#8217;re going to use <code>Function</code> objects directly, you&#8217;ve given up most of the speed advantages. If speed is not your goal, consider <code>EventDispatcher</code> or as3signals instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://jacksondunstan.com/articles/585/comment-page-1#comment-4166</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Wed, 23 Feb 2011 22:25:08 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=585#comment-4166</guid>
		<description>Just tried to create my own FunctionSignal1, all slots are now functions, so semantically they are a bit different but the idea is clear.

https://gist.github.com/9aeb57a266c7435684ef

&lt;pre lang=&quot;actionscript3&quot;&gt;
private var heroAdded:FunctionSignal1 = new FunctionSignal1();

// add &#039;listeners&#039; like this
heroAdded.addSlot(onHeroAdded);

// remove it like this:
heroAdded.removeSlot(onHeroAdded);

private function onHeroAdded(hero:Object):void 
{
	trace(&quot;cool, there is a hero added&quot;);
}
&lt;/pre&gt;
I don&#039;t know if this is performing as fast as the normal Signal1 with a FunctionSignal, haven&#039;t tested that, but I think this is more useable in normal projects since you can normally pass the listener function.</description>
		<content:encoded><![CDATA[<p>Just tried to create my own FunctionSignal1, all slots are now functions, so semantically they are a bit different but the idea is clear.</p>
<p><a href="https://gist.github.com/9aeb57a266c7435684ef" rel="nofollow">https://gist.github.com/9aeb57a266c7435684ef</a></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> heroAdded<span style="color: #000066; font-weight: bold;">:</span>FunctionSignal1 = <span style="color: #0033ff; font-weight: bold;">new</span> FunctionSignal1<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// add 'listeners' like this</span>
heroAdded<span style="color: #000066; font-weight: bold;">.</span>addSlot<span style="color: #000000;">&#40;</span>onHeroAdded<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// remove it like this:</span>
heroAdded<span style="color: #000066; font-weight: bold;">.</span>removeSlot<span style="color: #000000;">&#40;</span>onHeroAdded<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onHeroAdded<span style="color: #000000;">&#40;</span>hero<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
<span style="color: #000000;">&#123;</span>
    <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;cool, there is a hero added&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>I don&#8217;t know if this is performing as fast as the normal Signal1 with a FunctionSignal, haven&#8217;t tested that, but I think this is more useable in normal projects since you can normally pass the listener function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://jacksondunstan.com/articles/585/comment-page-1#comment-4165</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Wed, 23 Feb 2011 22:06:24 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=585#comment-4165</guid>
		<description>How do you remove a slot if you are using the FunctionSlot ?
The only way to remove it is to create a variable of the functionslot, like this?
&lt;pre lang=&quot;actionscript3&quot;&gt;
var heroFunctionSlot:FunctionSlot1;

heroAdded.addSlot(heroFunctionSlot = new FunctionSlot1(onHeroAdded)); // add slot

heroAdded.removeSlot( heroFunctionSlot ); 
&lt;/pre&gt;It would be great if there is an alternative to this. Maybe a FunctionSignal or something would be a great addition, which creates FunctionSlots inside the class like addSlot(func);</description>
		<content:encoded><![CDATA[<p>How do you remove a slot if you are using the FunctionSlot ?<br />
The only way to remove it is to create a variable of the functionslot, like this?</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> heroFunctionSlot<span style="color: #000066; font-weight: bold;">:</span>FunctionSlot1<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
heroAdded<span style="color: #000066; font-weight: bold;">.</span>addSlot<span style="color: #000000;">&#40;</span>heroFunctionSlot = <span style="color: #0033ff; font-weight: bold;">new</span> FunctionSlot1<span style="color: #000000;">&#40;</span>onHeroAdded<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// add slot</span>
&nbsp;
heroAdded<span style="color: #000066; font-weight: bold;">.</span>removeSlot<span style="color: #000000;">&#40;</span> heroFunctionSlot <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>It would be great if there is an alternative to this. Maybe a FunctionSignal or something would be a great addition, which creates FunctionSlots inside the class like addSlot(func);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/585/comment-page-1#comment-4044</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Sat, 19 Feb 2011 17:23:24 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=585#comment-4044</guid>
		<description>The dispatch performance should be the same as the non-static dispatch performance you see in the article. Only the static access (when you add slots, remove slots, or call &lt;code&gt;dispatch&lt;/code&gt;) would be slowed down.</description>
		<content:encoded><![CDATA[<p>The dispatch performance should be the same as the non-static dispatch performance you see in the article. Only the static access (when you add slots, remove slots, or call <code>dispatch</code>) would be slowed down.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://jacksondunstan.com/articles/585/comment-page-1#comment-4039</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Sat, 19 Feb 2011 13:26:35 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=585#comment-4039</guid>
		<description>Thanks for explaining, I wonder how much MyGlobalSignals.enterFrame.dispatch() vs MyGlobalEventDispatcher.dispatchEvent(new CustomEvent()) performs.</description>
		<content:encoded><![CDATA[<p>Thanks for explaining, I wonder how much MyGlobalSignals.enterFrame.dispatch() vs MyGlobalEventDispatcher.dispatchEvent(new CustomEvent()) performs.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

