

































<?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>Tue, 07 Feb 2012 19:10:46 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: Michael</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-580641</link>
		<pubDate>Thu, 10 Nov 2011 07:34:18 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-580641</guid>
					<description>Hi thanks for your post, I have a question.

I want a banner which pauses on an image for about 10 seconds, then moves to the next image for 10 seconds, and so on. there will be buttons so you can click to view one specific image (like the news section of this site: http://www.essendonfc.com.au/main.asp). 

I've made it so the movie loops by itself, but when you click a button to view one of the other images, it loops back to the start frame but is meant to wait for another 10 seconds on that image, but for some reason it only waits 7-8 seconds (or sometimes not at all).

Could you take a look and tell me where I've gone wrong? The link to the SWF is here (http://www.conceptmedia.com.au/banner.swf) and the link to the flash file is here (http://www.conceptmedia.com.au/banner.fla).</description>
		<content:encoded><![CDATA[<p>Hi thanks for your post, I have a question.</p>
<p>I want a banner which pauses on an image for about 10 seconds, then moves to the next image for 10 seconds, and so on. there will be buttons so you can click to view one specific image (like the news section of this site: <a href='http://www.essendonfc.com.au/main.asp' rel='nofollow'>http://www.essendonfc.com.au/main.asp</a>). </p>
<p>I&#8217;ve made it so the movie loops by itself, but when you click a button to view one of the other images, it loops back to the start frame but is meant to wait for another 10 seconds on that image, but for some reason it only waits 7-8 seconds (or sometimes not at all).</p>
<p>Could you take a look and tell me where I&#8217;ve gone wrong? The link to the SWF is here (http://www.conceptmedia.com.au/banner.swf) and the link to the flash file is here (http://www.conceptmedia.com.au/banner.fla).
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Pram</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-474562</link>
		<pubDate>Fri, 06 Aug 2010 06:04:07 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-474562</guid>
					<description>Hi David Stiller,
I need your help !!!!
I am developing a flash based presentation application for 

kiosk which need to reset or go to fist frame every time 

after 30 second when its not in use (as many people leave 

kiosk in middle of application which need to reset 

automatically after 30 sec)

Please let me know the code for automatic reset or go to 

stop in first frame of application in flash.

Waiting for your reply.
Thanks,
pram</description>
		<content:encoded><![CDATA[<p>Hi David Stiller,<br />
I need your help !!!!<br />
I am developing a flash based presentation application for </p>
<p>kiosk which need to reset or go to fist frame every time </p>
<p>after 30 second when its not in use (as many people leave </p>
<p>kiosk in middle of application which need to reset </p>
<p>automatically after 30 sec)</p>
<p>Please let me know the code for automatic reset or go to </p>
<p>stop in first frame of application in flash.</p>
<p>Waiting for your reply.<br />
Thanks,<br />
pram
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-403544</link>
		<pubDate>Wed, 15 Jul 2009 13:48:29 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-403544</guid>
					<description>&lt;strong&gt;To Kelley ...&lt;/strong&gt;

&lt;blockquote&gt;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.&lt;/blockquote&gt;

Gotcha.  :)  Fortunately, for this sort of pausing, where a timer isn't needed, the code is actually much simpler!

One of the issues with your code example is that you were combining the &lt;code&gt;on()&lt;/code&gt; and dot notation approaches for your &lt;code&gt;pauseBtn&lt;/code&gt; event handler.  The cleanest way I can think of to do this, assuming you have a pause button, a play button, and a content movie clip, is the following:

&lt;pre&gt;&lt;code&gt;pauseBtn.onRelease = function:Void {
  contentClip.stop();
};

playBtn.onRelease = function():Void {
  contentClip.play();
};&lt;/code&gt;&lt;/pre&gt;

In this situation, you don't have to reference the content clip's current frame, because when you invoke &lt;code&gt;MovieClip.stop()&lt;/code&gt; on it, it'll simply stop where it is, and be ready to resume later from that same frame.

Let me know if this makes senese (or doesn't)!  :)

&lt;strong&gt;To Pastor, Ab, ilike2flash, Sarjon ...&lt;/strong&gt;

Thanks!

&lt;strong&gt;To UzuNarU ...&lt;/strong&gt;

&lt;blockquote&gt;Is it possible to incorporate this into a button&lt;/blockquote&gt;

I'm guessing you'd want a pause button always present, where the user could &amp;#8212; at any time &amp;#8212; halt the action for x-number of seconds?  This would do it, assuming your pause button has the instance name &lt;code&gt;pauseBtn&lt;/code&gt;, and that it sits in the same timeline as the following code.

&lt;pre&gt;&lt;code&gt;var interval:Number;

pauseBtn.onRelease = pause;

function pause():Void {
  this._parent.stop();
  interval = setInterval(resume, 2000);
};
function resume():Void {
  play();
  clearInterval(interval);
};&lt;/code&gt;&lt;/pre&gt;

Note that the object reference for the main timeline is different for both custom functions.  In the &lt;code&gt;pause()&lt;/code&gt; function, the reference is &lt;code&gt;this._parent.stop();&lt;/code&gt;, because in AS2, this function's point of view (its scope) belongs to the &lt;code&gt;pauseBtn&lt;/code&gt; button, to whose &lt;code&gt;Button.onRelease&lt;/code&gt; event it's assigned.  In the &lt;code&gt;resume()&lt;/code&gt; function, no reference prefix is necessary &amp;#8212; simply &lt;code&gt;play()&lt;/code&gt; will do &amp;#8212; because the scope of this function belongs to the main timeline (where the code is written).

&lt;strong&gt;To Nicole ...&lt;/strong&gt;

Glad to hear it; thanks!

&lt;strong&gt;To Digitalex ...&lt;/strong&gt;

&lt;blockquote&gt;btw this is the first blog i’ve ever been inspired to partake in! and the most positive one&lt;/blockquote&gt;

Most positive is a high compliment!  Thank you!

&lt;strong&gt;To sandy ...&lt;/strong&gt;

&lt;blockquote&gt;Thank you…thank you…of course, it worked first time, every time!
Your style of explaining things is superb!!&lt;/blockquote&gt;

So glad to hear that.  Glad it's working out for you!  When the light bulb finally does &lt;em&gt;light&lt;/em&gt;, it really is a good feeling!</description>
		<content:encoded><![CDATA[<p><strong>To Kelley &#8230;</strong></p>
<blockquote><p>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.</p></blockquote>
<p>Gotcha.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Fortunately, for this sort of pausing, where a timer isn&#8217;t needed, the code is actually much simpler!</p>
<p>One of the issues with your code example is that you were combining the <code>on()</code> and dot notation approaches for your <code>pauseBtn</code> event handler.  The cleanest way I can think of to do this, assuming you have a pause button, a play button, and a content movie clip, is the following:</p>
<pre><code>pauseBtn.onRelease = function:Void {
  contentClip.stop();
};

playBtn.onRelease = function():Void {
  contentClip.play();
};</code></pre>
<p>In this situation, you don&#8217;t have to reference the content clip&#8217;s current frame, because when you invoke <code>MovieClip.stop()</code> on it, it&#8217;ll simply stop where it is, and be ready to resume later from that same frame.</p>
<p>Let me know if this makes senese (or doesn&#8217;t)!  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>To Pastor, Ab, ilike2flash, Sarjon &#8230;</strong></p>
<p>Thanks!</p>
<p><strong>To UzuNarU &#8230;</strong></p>
<blockquote><p>Is it possible to incorporate this into a button</p></blockquote>
<p>I&#8217;m guessing you&#8217;d want a pause button always present, where the user could &mdash; at any time &mdash; halt the action for x-number of seconds?  This would do it, assuming your pause button has the instance name <code>pauseBtn</code>, and that it sits in the same timeline as the following code.</p>
<pre><code>var interval:Number;

pauseBtn.onRelease = pause;

function pause():Void {
  this._parent.stop();
  interval = setInterval(resume, 2000);
};
function resume():Void {
  play();
  clearInterval(interval);
};</code></pre>
<p>Note that the object reference for the main timeline is different for both custom functions.  In the <code>pause()</code> function, the reference is <code>this._parent.stop();</code>, because in AS2, this function&#8217;s point of view (its scope) belongs to the <code>pauseBtn</code> button, to whose <code>Button.onRelease</code> event it&#8217;s assigned.  In the <code>resume()</code> function, no reference prefix is necessary &mdash; simply <code>play()</code> will do &mdash; because the scope of this function belongs to the main timeline (where the code is written).</p>
<p><strong>To Nicole &#8230;</strong></p>
<p>Glad to hear it; thanks!</p>
<p><strong>To Digitalex &#8230;</strong></p>
<blockquote><p>btw this is the first blog i’ve ever been inspired to partake in! and the most positive one</p></blockquote>
<p>Most positive is a high compliment!  Thank you!</p>
<p><strong>To sandy &#8230;</strong></p>
<blockquote><p>Thank you…thank you…of course, it worked first time, every time!<br />
Your style of explaining things is superb!!</p></blockquote>
<p>So glad to hear that.  Glad it&#8217;s working out for you!  When the light bulb finally does <em>light</em>, it really is a good feeling!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: sandy g</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-403507</link>
		<pubDate>Wed, 15 Jul 2009 08:45:25 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-403507</guid>
					<description>David...

Thank you...thank you...of course, it worked first time, every time!
Your style of explaining things is superb!!
I was able to make the connection between animated gifs and flash pausing finally. Now if I could get my movie to pause at the end and just loop 3 times, I would be ecstatic. Help. 

Your code on looping was fantastic and kept me from insanity. Now I need to put them together.

I know the lightbulb is coming on soon, lol. Thank you again.</description>
		<content:encoded><![CDATA[<p>David&#8230;</p>
<p>Thank you&#8230;thank you&#8230;of course, it worked first time, every time!<br />
Your style of explaining things is superb!!<br />
I was able to make the connection between animated gifs and flash pausing finally. Now if I could get my movie to pause at the end and just loop 3 times, I would be ecstatic. Help. </p>
<p>Your code on looping was fantastic and kept me from insanity. Now I need to put them together.</p>
<p>I know the lightbulb is coming on soon, lol. Thank you again.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Digitalex</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-402869</link>
		<pubDate>Sat, 11 Jul 2009 22:21:45 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-402869</guid>
					<description>secrets are never complex, they are profoundly simple, that's why they are kept secret!

thanks David

btw this is the first blog i've ever been inspired to partake in! and the most positive one</description>
		<content:encoded><![CDATA[<p>secrets are never complex, they are profoundly simple, that&#8217;s why they are kept secret!</p>
<p>thanks David</p>
<p>btw this is the first blog i&#8217;ve ever been inspired to partake in! and the most positive one
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: popflier</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-384557</link>
		<pubDate>Tue, 21 Apr 2009 08:56:31 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-384557</guid>
					<description>I spent hours looking for a solution for this online via tutorials, forums, etc... and nothing I tried worked until I came across your blog. I don't quite have it working right in AS3, but I'll keep working with it and adjusting. I saw someone else on another site was looking for this solution too. I will send them to your page.

Many thanks!
Nicole</description>
		<content:encoded><![CDATA[<p>I spent hours looking for a solution for this online via tutorials, forums, etc&#8230; and nothing I tried worked until I came across your blog. I don&#8217;t quite have it working right in AS3, but I&#8217;ll keep working with it and adjusting. I saw someone else on another site was looking for this solution too. I will send them to your page.</p>
<p>Many thanks!<br />
Nicole
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: UzuNarU</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-344084</link>
		<pubDate>Sun, 01 Feb 2009 20:42:51 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-344084</guid>
					<description>Site is down, but will be back shortly!

Anyways I really wanted to thank you for this piece of code, I spent a good 30 minutes trying to find this code for AS 2.0. It's been a little while since worked with Flash. Is it possible to incorporate this into a button or would I justt make the button go to the frame and the AS in that frames AS layer will automatically activate?

Thanks Again David</description>
		<content:encoded><![CDATA[<p>Site is down, but will be back shortly!</p>
<p>Anyways I really wanted to thank you for this piece of code, I spent a good 30 minutes trying to find this code for AS 2.0. It&#8217;s been a little while since worked with Flash. Is it possible to incorporate this into a button or would I justt make the button go to the frame and the AS in that frames AS layer will automatically activate?</p>
<p>Thanks Again David
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Sarjon</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-322890</link>
		<pubDate>Thu, 18 Dec 2008 16:24:43 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-322890</guid>
					<description>very helpful indeed</description>
		<content:encoded><![CDATA[<p>very helpful indeed
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: ilike2flash</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-320571</link>
		<pubDate>Sun, 14 Dec 2008 16:17:34 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-320571</guid>
					<description>Thanks, very helpful.</description>
		<content:encoded><![CDATA[<p>Thanks, very helpful.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Ab</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-313951</link>
		<pubDate>Thu, 04 Dec 2008 13:09:13 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-pause-timeline#comment-313951</guid>
					<description>David,

Spent ages looking for that snippet of knowledge.

Cheers Dave!</description>
		<content:encoded><![CDATA[<p>David,</p>
<p>Spent ages looking for that snippet of knowledge.</p>
<p>Cheers Dave!
</p>
]]></content:encoded>
				</item>
</channel>
</rss>

