<?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: AS3 Best Practice for Callback Evals</title>
	<atom:link href="http://www.jadbox.com/2009/02/as3-optional-callback-method-warning/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jadbox.com/2009/02/as3-optional-callback-method-warning/</link>
	<description>Programming, Visualization and Game Development Theory</description>
	<lastBuildDate>Tue, 15 Dec 2009 04:18:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Danny Miller</title>
		<link>http://www.jadbox.com/2009/02/as3-optional-callback-method-warning/comment-page-1/#comment-129</link>
		<dc:creator>Danny Miller</dc:creator>
		<pubDate>Sat, 28 Feb 2009 00:37:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.jadbox.com/?p=882#comment-129</guid>
		<description>Callbacks are fine but sort of the old way to do things... You should really use event listeners as that supports multiple &quot;call backs&quot; for a specific object.</description>
		<content:encoded><![CDATA[<p>Callbacks are fine but sort of the old way to do things&#8230; You should really use event listeners as that supports multiple &#8220;call backs&#8221; for a specific object.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tyler Wright</title>
		<link>http://www.jadbox.com/2009/02/as3-optional-callback-method-warning/comment-page-1/#comment-117</link>
		<dc:creator>Tyler Wright</dc:creator>
		<pubDate>Sat, 14 Feb 2009 16:08:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.jadbox.com/?p=882#comment-117</guid>
		<description>The most common way to handle this type of comparison:

&lt;code&gt;if(onSaveCallback != null) onSaveCallback()&lt;/code&gt;

...just a little easier.</description>
		<content:encoded><![CDATA[<p>The most common way to handle this type of comparison:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">if(onSaveCallback != null) onSaveCallback()</div></div>
<p>&#8230;just a little easier.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pleclech</title>
		<link>http://www.jadbox.com/2009/02/as3-optional-callback-method-warning/comment-page-1/#comment-116</link>
		<dc:creator>pleclech</dc:creator>
		<pubDate>Sat, 14 Feb 2009 14:42:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.jadbox.com/?p=882#comment-116</guid>
		<description>Hello,

First sorry for my bad English...

My 2 cents, it seems a bit overkill just to test nullity of a function, since the short way make flash compiler complained, try the explicit way:

function foo(bar:Function=null):void{
 if (bar!=null)
  bar();
}

It will be faster than cast to an object and then compare to a string.

Regards.</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>First sorry for my bad English&#8230;</p>
<p>My 2 cents, it seems a bit overkill just to test nullity of a function, since the short way make flash compiler complained, try the explicit way:</p>
<p>function foo(bar:Function=null):void{<br />
 if (bar!=null)<br />
  bar();<br />
}</p>
<p>It will be faster than cast to an object and then compare to a string.</p>
<p>Regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antoine</title>
		<link>http://www.jadbox.com/2009/02/as3-optional-callback-method-warning/comment-page-1/#comment-115</link>
		<dc:creator>Antoine</dc:creator>
		<pubDate>Sat, 14 Feb 2009 13:06:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.jadbox.com/?p=882#comment-115</guid>
		<description>Why not just do this test :

if(onSaveCallback != null) onSaveCallback();</description>
		<content:encoded><![CDATA[<p>Why not just do this test :</p>
<p>if(onSaveCallback != null) onSaveCallback();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Al</title>
		<link>http://www.jadbox.com/2009/02/as3-optional-callback-method-warning/comment-page-1/#comment-114</link>
		<dc:creator>Al</dc:creator>
		<pubDate>Sat, 14 Feb 2009 12:17:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.jadbox.com/?p=882#comment-114</guid>
		<description>How about using &#039;is&#039;:

 if(onSaveCallback is Function) onSaveCallback();

Can&#039;t help thinking a custom event is even cleaner...</description>
		<content:encoded><![CDATA[<p>How about using &#8216;is&#8217;:</p>
<p> if(onSaveCallback is Function) onSaveCallback();</p>
<p>Can&#8217;t help thinking a custom event is even cleaner&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mije</title>
		<link>http://www.jadbox.com/2009/02/as3-optional-callback-method-warning/comment-page-1/#comment-112</link>
		<dc:creator>Mije</dc:creator>
		<pubDate>Sat, 14 Feb 2009 08:33:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.jadbox.com/?p=882#comment-112</guid>
		<description>Hm. Why not do this simple check?

if(onSaveCallback !== null) onSaveCallback();</description>
		<content:encoded><![CDATA[<p>Hm. Why not do this simple check?</p>
<p>if(onSaveCallback !== null) onSaveCallback();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Theo Denovan</title>
		<link>http://www.jadbox.com/2009/02/as3-optional-callback-method-warning/comment-page-1/#comment-111</link>
		<dc:creator>Theo Denovan</dc:creator>
		<pubDate>Sat, 14 Feb 2009 08:09:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.jadbox.com/?p=882#comment-111</guid>
		<description>I believe the following also works:

if( functionArg is Function )</description>
		<content:encoded><![CDATA[<p>I believe the following also works:</p>
<p>if( functionArg is Function )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Schneble</title>
		<link>http://www.jadbox.com/2009/02/as3-optional-callback-method-warning/comment-page-1/#comment-110</link>
		<dc:creator>Nick Schneble</dc:creator>
		<pubDate>Sat, 14 Feb 2009 07:09:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.jadbox.com/?p=882#comment-110</guid>
		<description>There&#039;s actually an easier solution-

Instead of:
if(onSaveCallback) onSaveCallback();

Do this:
if(onSaveCallback != null) onSaveCallback();</description>
		<content:encoded><![CDATA[<p>There&#8217;s actually an easier solution-</p>
<p>Instead of:<br />
if(onSaveCallback) onSaveCallback();</p>
<p>Do this:<br />
if(onSaveCallback != null) onSaveCallback();</p>
]]></content:encoded>
	</item>
</channel>
</rss>
