<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How to Pause a Timeline (AS2)</title>
	<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline</link>
	<description>Luck is the residue of good design.</description>
	<pubDate>Wed, 19 Nov 2008 04:16:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: Pastor</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-199489</link>
		<pubDate>Wed, 11 Jun 2008 16:54:57 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-199489</guid>
					<description>Thanks, this script has been mighty helpful.

More power to you man!</description>
		<content:encoded><![CDATA[<p>Thanks, this script has been mighty helpful.</p>
<p>More power to you man!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Kelley</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-195863</link>
		<pubDate>Fri, 06 Jun 2008 12:22:04 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-195863</guid>
					<description>No, I just tried this and it does not work with my situation - I am trying to pause the currently running Movie Clip with a pause button, and then start the Movie Clip playing again using a play button.  I don't want timed pauses... the pause is indefinite, it is user defined.  This is the code I tried which did not work, attached to 'pauseBtn' which resides in the first frame of a pausePlay MovieClip (frame two is where playBtn resides): 

on (release) {
pauseBtn.onRelease = function():Void {
//move to the next frame for the play button
	gotoAndPlay(2);

//pause the MovieClip on the current frame
	gotoAndStop(&quot;_parent.currentFrame&quot;, 1);
	interval = setInterval(function():Void{ 
									clearInterval(interval);
									gotoAndStop(&quot;_parent.currentFrame&quot;, 1); 
									}  );
}
}


How do you utilize this method to pause a MovieClip in the current frame, and then start again from that frame?

Kelley</description>
		<content:encoded><![CDATA[<p>No, I just tried this and it does not work with my situation - I am trying to pause the currently running Movie Clip with a pause button, and then start the Movie Clip playing again using a play button.  I don&#8217;t want timed pauses&#8230; the pause is indefinite, it is user defined.  This is the code I tried which did not work, attached to &#8216;pauseBtn&#8217; which resides in the first frame of a pausePlay MovieClip (frame two is where playBtn resides): </p>
<p>on (release) {<br />
pauseBtn.onRelease = function():Void {<br />
//move to the next frame for the play button<br />
	gotoAndPlay(2);</p>
<p>//pause the MovieClip on the current frame<br />
	gotoAndStop(&#8221;_parent.currentFrame&#8221;, 1);<br />
	interval = setInterval(function():Void{<br />
									clearInterval(interval);<br />
									gotoAndStop(&#8221;_parent.currentFrame&#8221;, 1);<br />
									}  );<br />
}<br />
}</p>
<p>How do you utilize this method to pause a MovieClip in the current frame, and then start again from that frame?</p>
<p>Kelley
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Kelley</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-195834</link>
		<pubDate>Fri, 06 Jun 2008 11:49:41 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-195834</guid>
					<description>This appears to be the answer I am looking for - the proper code to attach to a button which, when clicked, causes the timeline to pause - however, I want to pause on the CURRENT frame, and then on a click, UNPAUSE on the same frame.  How do I tell the program to recognize whatever the current frame is?</description>
		<content:encoded><![CDATA[<p>This appears to be the answer I am looking for - the proper code to attach to a button which, when clicked, causes the timeline to pause - however, I want to pause on the CURRENT frame, and then on a click, UNPAUSE on the same frame.  How do I tell the program to recognize whatever the current frame is?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-180095</link>
		<pubDate>Fri, 09 May 2008 04:03:59 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-180095</guid>
					<description>&lt;strong&gt;To Alex ...&lt;/strong&gt;

Thanks!

&lt;strong&gt;To Neilando ...&lt;/strong&gt;

If you're using &lt;code&gt;on()&lt;/code&gt;, then your code has to be attached directly to the button.  I recommend you go with a keyframe version of the same event handler, described in the &quot;&lt;a href=&quot;http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;museum pieces&lt;/a&gt;&quot; entry of this blog.  Regardless, the following should work, based on your description (this assumes a button with the instance name &lt;code&gt;myButton&lt;/code&gt;):

&lt;pre&gt;&lt;code&gt;stop();
var interval:Number;
myButton.onRelease = function():Void {
  gotoAndStop(10);
  interval = setInterval(
    function():Void {
      clearInterval(interval);
      gotoAndStop(20);
    },
    2000
  );
}&lt;/code&gt;&lt;/pre&gt;

That looks a bit messy, but all it does is send the playhead immediately to frame 10, where it stops, then waits 2 seconds before sending it to frame 20, where it stops again.

Does that make sense?  All of the above code would go into whatever frame (I'm assuming frame 1) the button appears in.</description>
		<content:encoded><![CDATA[<p><strong>To Alex &#8230;</strong></p>
<p>Thanks!</p>
<p><strong>To Neilando &#8230;</strong></p>
<p>If you&#8217;re using <code>on()</code>, then your code has to be attached directly to the button.  I recommend you go with a keyframe version of the same event handler, described in the &#8220;<a href="http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent" target="_blank" rel="nofollow">museum pieces</a>&#8221; entry of this blog.  Regardless, the following should work, based on your description (this assumes a button with the instance name <code>myButton</code>):</p>
<pre><code>stop();
var interval:Number;
myButton.onRelease = function():Void {
  gotoAndStop(10);
  interval = setInterval(
    function():Void {
      clearInterval(interval);
      gotoAndStop(20);
    },
    2000
  );
}</code></pre>
<p>That looks a bit messy, but all it does is send the playhead immediately to frame 10, where it stops, then waits 2 seconds before sending it to frame 20, where it stops again.</p>
<p>Does that make sense?  All of the above code would go into whatever frame (I&#8217;m assuming frame 1) the button appears in.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Neilando</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-171859</link>
		<pubDate>Tue, 29 Apr 2008 12:49:00 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-171859</guid>
					<description>Hi. I am a total novice at AS. I am trying to get your code to work, with a small change. I want to execute your code on a button click, so that when the button is clicked, the timeline goes to a certain frame, pauses, then goes onto another specidic frameafter it has unpaused. How can i do that?

on (release) {
	gotoAndPlay(10);
var interval:Number = setInterval(
  function():Void {
    play();
    clearInterval(interval);
  },
  2000
); 
}

Where do i add the code to restart the timeline from a specific frame??</description>
		<content:encoded><![CDATA[<p>Hi. I am a total novice at AS. I am trying to get your code to work, with a small change. I want to execute your code on a button click, so that when the button is clicked, the timeline goes to a certain frame, pauses, then goes onto another specidic frameafter it has unpaused. How can i do that?</p>
<p>on (release) {<br />
	gotoAndPlay(10);<br />
var interval:Number = setInterval(<br />
  function():Void {<br />
    play();<br />
    clearInterval(interval);<br />
  },<br />
  2000<br />
);<br />
}</p>
<p>Where do i add the code to restart the timeline from a specific frame??
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alex</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-170500</link>
		<pubDate>Sat, 26 Apr 2008 15:12:24 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-170500</guid>
					<description>Wow! this is some really useful info! Thanks so much david i really appreciate it!</description>
		<content:encoded><![CDATA[<p>Wow! this is some really useful info! Thanks so much david i really appreciate it!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-160437</link>
		<pubDate>Thu, 10 Apr 2008 19:07:35 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-160437</guid>
					<description>Ryan,

You're very welcome.  Glad I could help!</description>
		<content:encoded><![CDATA[<p>Ryan,</p>
<p>You&#8217;re very welcome.  Glad I could help!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Ryan</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-160391</link>
		<pubDate>Thu, 10 Apr 2008 17:46:33 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-160391</guid>
					<description>Thanks so much David! I read your help to Lucas way back from June 2006 to clear the interval when a button is pressed! Your hands on help, expertise, and ability to convey Actionscript lessons in an easy-to-understand way are greatly appreciated!!!

Thnx again!</description>
		<content:encoded><![CDATA[<p>Thanks so much David! I read your help to Lucas way back from June 2006 to clear the interval when a button is pressed! Your hands on help, expertise, and ability to convey Actionscript lessons in an easy-to-understand way are greatly appreciated!!!</p>
<p>Thnx again!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-156117</link>
		<pubDate>Tue, 01 Apr 2008 14:38:28 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-156117</guid>
					<description>&lt;strong&gt;To Eugen S ...&lt;/strong&gt;

Glad to hear it!

&lt;strong&gt;To Wendy ...&lt;/strong&gt;

You're welcome.  :)</description>
		<content:encoded><![CDATA[<p><strong>To Eugen S &#8230;</strong></p>
<p>Glad to hear it!</p>
<p><strong>To Wendy &#8230;</strong></p>
<p>You&#8217;re welcome.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Wendy</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-155924</link>
		<pubDate>Tue, 01 Apr 2008 06:55:46 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-155924</guid>
					<description>I had been searching for this snippet of code for literally HOURS!!!  I was so frustrated - Thank you!  I finally found your code via a Google search after trying several fancier scripts that just wouldn't work for some reason.  Thank you!!!

Wendy</description>
		<content:encoded><![CDATA[<p>I had been searching for this snippet of code for literally HOURS!!!  I was so frustrated - Thank you!  I finally found your code via a Google search after trying several fancier scripts that just wouldn&#8217;t work for some reason.  Thank you!!!</p>
<p>Wendy
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
