<?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: pause Timer with ExtendedTimer in ActionScript 3.0</title>
	<atom:link href="http://blog.fjakobs.com/archives/101/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.fjakobs.com/archives/101</link>
	<description>FLASH BLOG</description>
	<lastBuildDate>Sun, 07 Mar 2010 03:52:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Stewpitty</title>
		<link>http://blog.fjakobs.com/archives/101/comment-page-1#comment-10589</link>
		<dc:creator>Stewpitty</dc:creator>
		<pubDate>Sat, 06 Mar 2010 23:40:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fjakobs.com/?p=101#comment-10589</guid>
		<description>Starbuzz [url=http://www.maharajahookah.com]hookah[/url] Tobacco
&lt;a href=&quot;http://www.maharajahookah.com&quot; rel=&quot;nofollow&quot;&gt;hookah&lt;/a&gt;
&lt;a href=&quot;http://www.maharajahookah.com/charcoal/cat_9.html&quot; rel=&quot;nofollow&quot;&gt;hookah charcoal&lt;/a&gt;
&lt;a href=&quot;http://www.maharajahookah.com/starbuzz/cat_11.html&quot; rel=&quot;nofollow&quot;&gt;starbuzz&lt;/a&gt;
&lt;a href=&quot;http://www.maharajahookah.com/al-fakher-shisha/cat_14.html&quot; rel=&quot;nofollow&quot;&gt;al fakher&lt;/a&gt;
&lt;a href=&quot;http://www.maharajahookah.com/index.php&quot; rel=&quot;nofollow&quot;&gt;hookahs&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Starbuzz [url=http://www.maharajahookah.com]hookah[/url] Tobacco<br />
<a href="http://www.maharajahookah.com" rel="nofollow">hookah</a><br />
<a href="http://www.maharajahookah.com/charcoal/cat_9.html" rel="nofollow">hookah charcoal</a><br />
<a href="http://www.maharajahookah.com/starbuzz/cat_11.html" rel="nofollow">starbuzz</a><br />
<a href="http://www.maharajahookah.com/al-fakher-shisha/cat_14.html" rel="nofollow">al fakher</a><br />
<a href="http://www.maharajahookah.com/index.php" rel="nofollow">hookahs</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: seoritm</title>
		<link>http://blog.fjakobs.com/archives/101/comment-page-1#comment-10588</link>
		<dc:creator>seoritm</dc:creator>
		<pubDate>Sat, 06 Mar 2010 23:10:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fjakobs.com/?p=101#comment-10588</guid>
		<description>&lt;a href=&quot;http://seo-miheeff.ru&quot; rel=&quot;nofollow&quot;&gt;seo&lt;/a&gt;
продвижение доски объявлений, раскрутка сайта продвижение сайта интернет реклама seo поисковая оптимизация сайта http://seo-miheeff.ru раскрутка автомойки.</description>
		<content:encoded><![CDATA[<p><a href="http://seo-miheeff.ru" rel="nofollow">seo</a><br />
продвижение доски объявлений, раскрутка сайта продвижение сайта интернет реклама seo поисковая оптимизация сайта <a href="http://seo-miheeff.ru" rel="nofollow">http://seo-miheeff.ru</a> раскрутка автомойки.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roy</title>
		<link>http://blog.fjakobs.com/archives/101/comment-page-1#comment-8779</link>
		<dc:creator>Roy</dc:creator>
		<pubDate>Wed, 13 Jan 2010 14:50:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fjakobs.com/?p=101#comment-8779</guid>
		<description>Hi, Thanx for the tut. I am working on this with a project of mine but it doesn&#039;t work.
First I import the class:
import com.fjakobs.utils.*
Then I create the timer:
var newTimer:Number = 5000;
var slideTimer:ExtendedTimer = new ExtendedTimer(newTimer);
function onSlideFadeIn():void {
	// check, if the slideshow is currently playing
	// if so, start the timer again
	if (bolPlaying &amp;&amp; ! slideTimer.running) {
		slideTimer.start();
	}
}

I am using this class with this code showed on this website:
http://www.thetechlabs.com/tutorials/xml/extending-the-as3flash9-slideshow-with-xml/

I hope someone can help me with this,
thanx</description>
		<content:encoded><![CDATA[<p>Hi, Thanx for the tut. I am working on this with a project of mine but it doesn&#8217;t work.<br />
First I import the class:<br />
import com.fjakobs.utils.*<br />
Then I create the timer:<br />
var newTimer:Number = 5000;<br />
var slideTimer:ExtendedTimer = new ExtendedTimer(newTimer);<br />
function onSlideFadeIn():void {<br />
	// check, if the slideshow is currently playing<br />
	// if so, start the timer again<br />
	if (bolPlaying &amp;&amp; ! slideTimer.running) {<br />
		slideTimer.start();<br />
	}<br />
}</p>
<p>I am using this class with this code showed on this website:<br />
<a href="http://www.thetechlabs.com/tutorials/xml/extending-the-as3flash9-slideshow-with-xml/" rel="nofollow">http://www.thetechlabs.com/tutorials/xml/extending-the-as3flash9-slideshow-with-xml/</a></p>
<p>I hope someone can help me with this,<br />
thanx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tommy</title>
		<link>http://blog.fjakobs.com/archives/101/comment-page-1#comment-7432</link>
		<dc:creator>Tommy</dc:creator>
		<pubDate>Fri, 04 Dec 2009 19:05:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fjakobs.com/?p=101#comment-7432</guid>
		<description>It seems the error comes into play when the timer count gets reset.
Try running a timer with an interval of 50ms and pause it every other second while looking at yr trace window.

If anyone has an opinion about this error feel free to share, i have no idea why this is occurring.
Kudos for the class! Gets the job done and is very usefull with minimal fancyness</description>
		<content:encoded><![CDATA[<p>It seems the error comes into play when the timer count gets reset.<br />
Try running a timer with an interval of 50ms and pause it every other second while looking at yr trace window.</p>
<p>If anyone has an opinion about this error feel free to share, i have no idea why this is occurring.<br />
Kudos for the class! Gets the job done and is very usefull with minimal fancyness</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tommy</title>
		<link>http://blog.fjakobs.com/archives/101/comment-page-1#comment-7294</link>
		<dc:creator>Tommy</dc:creator>
		<pubDate>Tue, 01 Dec 2009 11:39:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fjakobs.com/?p=101#comment-7294</guid>
		<description>hi there

I&#039;m using Kipp&#039;s compilation to the letter. Everything seems to be working fine but i get an error nonetheless.
Can anyone help?

RangeError: Error #2066: The Timer delay specified is out of range.
	at Error$/throwError()
	at flash.utils::Timer/set delay()
	at com.fjakobs.utils::ExtendedTimer/pause()
	at be.figure8::SimpleSlideshow/pause()
	at pages::ShowPage/pauseEvent()</description>
		<content:encoded><![CDATA[<p>hi there</p>
<p>I&#8217;m using Kipp&#8217;s compilation to the letter. Everything seems to be working fine but i get an error nonetheless.<br />
Can anyone help?</p>
<p>RangeError: Error #2066: The Timer delay specified is out of range.<br />
	at Error$/throwError()<br />
	at flash.utils::Timer/set delay()<br />
	at com.fjakobs.utils::ExtendedTimer/pause()<br />
	at be.figure8::SimpleSlideshow/pause()<br />
	at pages::ShowPage/pauseEvent()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nate Chatellier</title>
		<link>http://blog.fjakobs.com/archives/101/comment-page-1#comment-6915</link>
		<dc:creator>Nate Chatellier</dc:creator>
		<pubDate>Mon, 16 Nov 2009 18:48:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fjakobs.com/?p=101#comment-6915</guid>
		<description>Thanks for the compilation Kipp!</description>
		<content:encoded><![CDATA[<p>Thanks for the compilation Kipp!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kipp</title>
		<link>http://blog.fjakobs.com/archives/101/comment-page-1#comment-5595</link>
		<dc:creator>Kipp</dc:creator>
		<pubDate>Fri, 04 Sep 2009 18:07:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fjakobs.com/?p=101#comment-5595</guid>
		<description>Here is the version I compiled with all of the above changes. It seems to be working great! Hope this helps everyone. I know this has been a huge benefit to me!
-Kipp

------------------

package com.fjakobs.utils 
{
	import flash.events.TimerEvent;	
	import flash.utils.Timer;

	/**
	 * @author fjakobs
	 */
	public class ExtendedTimer extends Timer 
	{
		private var _startTime : Number;
		private var _initialDelay : Number;
		private var _paused : Boolean = false;

		public function ExtendedTimer(delay : Number, repeatCount : int = 0)
		{
			super(delay, repeatCount);
			_initialDelay = delay;
			addEventListener(TimerEvent.TIMER, onTimer, false, 0, true);
		}

		private function onTimer(event : TimerEvent) : void
		{
			_startTime = new Date().time;
			delay = _initialDelay;
		}

		// timer gets reset
		override public function start() : void
		{
			if((currentCount &lt; repeatCount) &#124;&#124; (repeatCount == 0))
			{
				delay = _initialDelay; // added to “reset” timer
				_paused = false;
				_startTime = new Date().time;
				super.start();
			}
		}


		public function pause() : void 
		{
			if(running)
			{
				_paused = true;
				stop();
				var newDelay:Number = delay - (new Date().time - _startTime);
				super.delay = (newDelay &lt; 0) ? 0 : newDelay;
			}
		}

		// timer continues from where it left off
		public function resume() : void
		{
			if((currentCount &lt; repeatCount) &#124;&#124; (repeatCount == 0))
			{
				_paused = false;
				_startTime = new Date().time;
				super.start();
			}
		}

		override public function set delay(n:Number):void {
			super.delay = _initialDelay = n;
		}
		
		public function get paused() : Boolean
		{
			return _paused;
		}

		public function get initialDelay() : Number
		{
			return _initialDelay;
		}
	}
}</description>
		<content:encoded><![CDATA[<p>Here is the version I compiled with all of the above changes. It seems to be working great! Hope this helps everyone. I know this has been a huge benefit to me!<br />
-Kipp</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>package com.fjakobs.utils<br />
{<br />
	import flash.events.TimerEvent;<br />
	import flash.utils.Timer;</p>
<p>	/**<br />
	 * @author fjakobs<br />
	 */<br />
	public class ExtendedTimer extends Timer<br />
	{<br />
		private var _startTime : Number;<br />
		private var _initialDelay : Number;<br />
		private var _paused : Boolean = false;</p>
<p>		public function ExtendedTimer(delay : Number, repeatCount : int = 0)<br />
		{<br />
			super(delay, repeatCount);<br />
			_initialDelay = delay;<br />
			addEventListener(TimerEvent.TIMER, onTimer, false, 0, true);<br />
		}</p>
<p>		private function onTimer(event : TimerEvent) : void<br />
		{<br />
			_startTime = new Date().time;<br />
			delay = _initialDelay;<br />
		}</p>
<p>		// timer gets reset<br />
		override public function start() : void<br />
		{<br />
			if((currentCount &lt; repeatCount) || (repeatCount == 0))<br />
			{<br />
				delay = _initialDelay; // added to “reset” timer<br />
				_paused = false;<br />
				_startTime = new Date().time;<br />
				super.start();<br />
			}<br />
		}</p>
<p>		public function pause() : void<br />
		{<br />
			if(running)<br />
			{<br />
				_paused = true;<br />
				stop();<br />
				var newDelay:Number = delay &#8211; (new Date().time &#8211; _startTime);<br />
				super.delay = (newDelay &lt; 0) ? 0 : newDelay;<br />
			}<br />
		}</p>
<p>		// timer continues from where it left off<br />
		public function resume() : void<br />
		{<br />
			if((currentCount &lt; repeatCount) || (repeatCount == 0))<br />
			{<br />
				_paused = false;<br />
				_startTime = new Date().time;<br />
				super.start();<br />
			}<br />
		}</p>
<p>		override public function set delay(n:Number):void {<br />
			super.delay = _initialDelay = n;<br />
		}</p>
<p>		public function get paused() : Boolean<br />
		{<br />
			return _paused;<br />
		}</p>
<p>		public function get initialDelay() : Number<br />
		{<br />
			return _initialDelay;<br />
		}<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: btb</title>
		<link>http://blog.fjakobs.com/archives/101/comment-page-1#comment-5394</link>
		<dc:creator>btb</dc:creator>
		<pubDate>Sun, 23 Aug 2009 20:09:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fjakobs.com/?p=101#comment-5394</guid>
		<description>does anyone have a stable, complete, working, tested, etc, version of this? I see a bunch of evolution going on, wondering if I could get a final version? thanks to all</description>
		<content:encoded><![CDATA[<p>does anyone have a stable, complete, working, tested, etc, version of this? I see a bunch of evolution going on, wondering if I could get a final version? thanks to all</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://blog.fjakobs.com/archives/101/comment-page-1#comment-5349</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Wed, 19 Aug 2009 13:54:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fjakobs.com/?p=101#comment-5349</guid>
		<description>I should also mention that if you implement my fix from above, then you should change line 46 to:
super.delay = delay - (new Date().time - _startTime);
...unless you also use DorkBot&#039;s fix (recommended), then change his line delay = thisDelay; into super.delay = thisDelay;</description>
		<content:encoded><![CDATA[<p>I should also mention that if you implement my fix from above, then you should change line 46 to:<br />
super.delay = delay &#8211; (new Date().time &#8211; _startTime);<br />
&#8230;unless you also use DorkBot&#8217;s fix (recommended), then change his line delay = thisDelay; into super.delay = thisDelay;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://blog.fjakobs.com/archives/101/comment-page-1#comment-5233</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 06 Aug 2009 14:00:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fjakobs.com/?p=101#comment-5233</guid>
		<description>Great little class. Just one thing I&#039;d like to add which may be useful to others. I found that if I&#039;d set the delay after the class was instantiated, then the specified delay would only work once, and afterwards it would revert to the original delay that was specified when the class was created. After adding the following, the problem was solved :)

override public function set delay(n:Number):void {
	super.delay = n;
	_initialDelay = n;
}</description>
		<content:encoded><![CDATA[<p>Great little class. Just one thing I&#8217;d like to add which may be useful to others. I found that if I&#8217;d set the delay after the class was instantiated, then the specified delay would only work once, and afterwards it would revert to the original delay that was specified when the class was created. After adding the following, the problem was solved <img src='http://blog.fjakobs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>override public function set delay(n:Number):void {<br />
	super.delay = n;<br />
	_initialDelay = n;<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
