

<?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: setTimeout() &#8220;Gotcha&#8221; in Class Files</title>
	<atom:link href="http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files/feed" rel="self" type="application/rss+xml" />
	<link>http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files</link>
	<description>Luck is the residue of good design.</description>
	<lastBuildDate>Tue, 20 Mar 2012 15:33:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files#comment-73492</link>
		<dc:creator>David Stiller</dc:creator>
		<pubDate>Fri, 17 Aug 2007 14:35:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files#comment-73492</guid>
		<description>annie,

Thanks for that.  :)  You&#039;re right, it isn&#039;t especially obvious how to use arguments with &lt;code&gt;setInterval()&lt;/code&gt;.  In addition, this function happens to have two alternate uses, as you&#039;ve shown in your reply:  an object reference may optionally be supplied as the first parameter, shoving the remaining parameters over a slot.  The object reference affords basically the same benefit as using the &lt;code&gt;Delegate.create()&lt;/code&gt; method.</description>
		<content:encoded><![CDATA[<p>annie,</p>
<p>Thanks for that.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   You&#8217;re right, it isn&#8217;t especially obvious how to use arguments with <code>setInterval()</code>.  In addition, this function happens to have two alternate uses, as you&#8217;ve shown in your reply:  an object reference may optionally be supplied as the first parameter, shoving the remaining parameters over a slot.  The object reference affords basically the same benefit as using the <code>Delegate.create()</code> method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: annie</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files#comment-73465</link>
		<dc:creator>annie</dc:creator>
		<pubDate>Fri, 17 Aug 2007 01:44:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files#comment-73465</guid>
		<description>I know this is from a while ago, but yet again I was directed to your site for help :)

It took me a little while to find out how to call a function in setTimout if the function has arguments, so I thought I&#039;d share it here.

You have to call them after the interval:

setTimeout( obj, methodName:String , duration:Number, [arg1, arg2, ...]) ;

Source: http://wiki.mediabox.fr/tutoriaux/flash/settimeout</description>
		<content:encoded><![CDATA[<p>I know this is from a while ago, but yet again I was directed to your site for help <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It took me a little while to find out how to call a function in setTimout if the function has arguments, so I thought I&#8217;d share it here.</p>
<p>You have to call them after the interval:</p>
<p>setTimeout( obj, methodName:String , duration:Number, [arg1, arg2, ...]) ;</p>
<p>Source: <a href="http://wiki.mediabox.fr/tutoriaux/flash/settimeout" rel="nofollow">http://wiki.mediabox.fr/tutoriaux/flash/settimeout</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NSurveyor</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files#comment-13474</link>
		<dc:creator>NSurveyor</dc:creator>
		<pubDate>Sun, 21 Jan 2007 03:14:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files#comment-13474</guid>
		<description>Good point. I&#039;ve been putting lines of code such as: _global[&quot; n&quot;];, compiling, and then decompiling, to see how it works. And after a little bit of testing, I find that if it is an illegal variable, it will not remove the eval/array access operator, otherwise it will.</description>
		<content:encoded><![CDATA[<p>Good point. I&#8217;ve been putting lines of code such as: _global[" n"];, compiling, and then decompiling, to see how it works. And after a little bit of testing, I find that if it is an illegal variable, it will not remove the eval/array access operator, otherwise it will.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files#comment-13450</link>
		<dc:creator>David Stiller</dc:creator>
		<pubDate>Sat, 20 Jan 2007 23:45:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files#comment-13450</guid>
		<description>NSurveyor,

That makes sense.  The array access operator does, however, allow references to illegal variable names such as numerals.  That prompts all sorts of new questions for me on how the compiler works.

I just tested &lt;code&gt;_global. n = 5;&lt;/code&gt;, for example.  That two-character property &lt;code&gt;&#160;n&lt;/code&gt; shouldn&#039;t work, because the first character is a space &#8212; yet it does.</description>
		<content:encoded><![CDATA[<p>NSurveyor,</p>
<p>That makes sense.  The array access operator does, however, allow references to illegal variable names such as numerals.  That prompts all sorts of new questions for me on how the compiler works.</p>
<p>I just tested <code>_global. n = 5;</code>, for example.  That two-character property <code>&nbsp;n</code> shouldn&#8217;t work, because the first character is a space &mdash; yet it does.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NSurveyor</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files#comment-13411</link>
		<dc:creator>NSurveyor</dc:creator>
		<pubDate>Sat, 20 Jan 2007 18:23:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files#comment-13411</guid>
		<description>Also, when you use eval(&quot;this.somestring&quot;) or this[&quot;somestring&quot;], it is compiled as this.somestring because the compiler knows that when evaluating a literal string, it will have the same end result as using that literal string as a variable. So if _global[&quot;setTimeout&quot;] does work, then surely _global.setTimeout would too.</description>
		<content:encoded><![CDATA[<p>Also, when you use eval(&#8220;this.somestring&#8221;) or this["somestring"], it is compiled as this.somestring because the compiler knows that when evaluating a literal string, it will have the same end result as using that literal string as a variable. So if _global["setTimeout"] does work, then surely _global.setTimeout would too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files#comment-12998</link>
		<dc:creator>David Stiller</dc:creator>
		<pubDate>Wed, 17 Jan 2007 18:55:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files#comment-12998</guid>
		<description>Davel_x,

Ha!  Yes, you&#039;re right.  The array access operator isn&#039;t needed.  Thanks for pointing that out!</description>
		<content:encoded><![CDATA[<p>Davel_x,</p>
<p>Ha!  Yes, you&#8217;re right.  The array access operator isn&#8217;t needed.  Thanks for pointing that out!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davel_x</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files#comment-12983</link>
		<dc:creator>Davel_x</dc:creator>
		<pubDate>Wed, 17 Jan 2007 17:28:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/settimeout-gotcha-in-class-files#comment-12983</guid>
		<description>According to this page : 
http://wiki.media-box.net/tutoriaux/flash/settimeout
simply typing _global.setTimeout() works too, have you tried ?

I didn&#039;t know this function and I needed it just... now ! :) I could have done things with a setInterval but this is much more clean :) Thanks !</description>
		<content:encoded><![CDATA[<p>According to this page :<br />
<a href="http://wiki.media-box.net/tutoriaux/flash/settimeout" rel="nofollow">http://wiki.media-box.net/tutoriaux/flash/settimeout</a><br />
simply typing _global.setTimeout() works too, have you tried ?</p>
<p>I didn&#8217;t know this function and I needed it just&#8230; now ! <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I could have done things with a setInterval but this is much more clean <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Thanks !</p>
]]></content:encoded>
	</item>
</channel>
</rss>

