<?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: Creating timers using the setTimeout method</title>
	<atom:link href="http://blog.flexexamples.com/2008/02/15/creating-timers-using-the-settimeout-method/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2008/02/15/creating-timers-using-the-settimeout-method/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sun, 12 Feb 2012 14:19:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Thiago</title>
		<link>http://blog.flexexamples.com/2008/02/15/creating-timers-using-the-settimeout-method/comment-page-1/#comment-9533</link>
		<dc:creator>Thiago</dc:creator>
		<pubDate>Thu, 25 Aug 2011 06:52:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/02/15/creating-timers-using-the-settimeout-method/#comment-9533</guid>
		<description>Hi Mashall, good one event.clone(). Solve my problems here.

thanks</description>
		<content:encoded><![CDATA[<p>Hi Mashall, good one event.clone(). Solve my problems here.</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2008/02/15/creating-timers-using-the-settimeout-method/comment-page-1/#comment-7081</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Mon, 22 Feb 2010 23:58:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/02/15/creating-timers-using-the-settimeout-method/#comment-7081</guid>
		<description>@Marshall,

You could try filing a bug at http://bugs.adobe.com/flashplayer/ and try attaching a simple case. It doesn&#039;t sound like an expected result.
How about if you try cloning the event object before passing it to the &lt;code&gt;setTimeout()&lt;/code&gt; method?
&lt;pre lang=&quot;actionscript3&quot;&gt;
setTimeout(myMethod,300,event.clone());
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>@Marshall,</p>
<p>You could try filing a bug at <a href="http://bugs.adobe.com/flashplayer/" rel="nofollow">http://bugs.adobe.com/flashplayer/</a> and try attaching a simple case. It doesn&#8217;t sound like an expected result.<br />
How about if you try cloning the event object before passing it to the <code>setTimeout()</code> method?</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #004993;">setTimeout</span><span style="color: #000000;">&#40;</span>myMethod<span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">300</span><span style="color: #000066; font-weight: bold;">,</span>event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">clone</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marshall</title>
		<link>http://blog.flexexamples.com/2008/02/15/creating-timers-using-the-settimeout-method/comment-page-1/#comment-7080</link>
		<dc:creator>Marshall</dc:creator>
		<pubDate>Mon, 22 Feb 2010 22:04:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/02/15/creating-timers-using-the-settimeout-method/#comment-7080</guid>
		<description>Thanks very much for your great work on this blog. I&#039;ve learned a lot!

 I&#039;m working with code almost exactly like your second exmaple. I want to call a piece of code using the setTimeout() method. However, I&#039;ve found an issue with how it passes parameters to the method it will call.  My code is as follows:

function foo(event:MouseEvent):void
{
      setTimeout(myMethod,300,event);
}

myMethod(event:MouseEvent)
{
...
}

The problem is, that the event object, which I am passing as a paremeter through the setTimer() method is being changed during the passing. The currentTarget is DIFFERENT for the event being set as a paremeter on setTimeout and the event being passed to myMethod by setTimeout().

The code in MyMethod uses the event, and eventually passes it to doDrag() in the DragManager so I need my event intact. 

Any ideas about why the currentTarget property is being changed by the setTimout() call? Any way I can get around this?</description>
		<content:encoded><![CDATA[<p>Thanks very much for your great work on this blog. I&#8217;ve learned a lot!</p>
<p> I&#8217;m working with code almost exactly like your second exmaple. I want to call a piece of code using the setTimeout() method. However, I&#8217;ve found an issue with how it passes parameters to the method it will call.  My code is as follows:</p>
<p>function foo(event:MouseEvent):void<br />
{<br />
      setTimeout(myMethod,300,event);<br />
}</p>
<p>myMethod(event:MouseEvent)<br />
{<br />
&#8230;<br />
}</p>
<p>The problem is, that the event object, which I am passing as a paremeter through the setTimer() method is being changed during the passing. The currentTarget is DIFFERENT for the event being set as a paremeter on setTimeout and the event being passed to myMethod by setTimeout().</p>
<p>The code in MyMethod uses the event, and eventually passes it to doDrag() in the DragManager so I need my event intact. </p>
<p>Any ideas about why the currentTarget property is being changed by the setTimout() call? Any way I can get around this?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

