<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The web page of Dan</title>
	<atom:link href="http://www.thewebpageofdan.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thewebpageofdan.com</link>
	<description></description>
	<lastBuildDate>Tue, 25 Nov 2008 20:36:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flash text fields have extra newlines/carriage returns (&#8221;\n&#8221; and &#8220;\r&#8221;)</title>
		<link>http://www.thewebpageofdan.com/2008/11/25/actionscript-text-fields-have-extra-newlinescarriage-returns-n-and-r/</link>
		<comments>http://www.thewebpageofdan.com/2008/11/25/actionscript-text-fields-have-extra-newlinescarriage-returns-n-and-r/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 04:59:09 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
		
		<guid isPermaLink="false">http://localhost/dan/?p=204</guid>
		<description><![CDATA[I&#8217;ve discovered a few interesting quirks of text fields while I&#8217;ve been working with Flash lately and want to share one with you (I&#8217;ll share the other in a later post).  While working with TextField objects, I noticed that a carriage return is appended to any value that is entered into a text field [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve discovered a few interesting quirks of text fields while I&#8217;ve been working with Flash lately and want to share one with you (I&#8217;ll share the other in a later post).  While working with TextField objects, I noticed that <strong>a carriage return is appended to any value that is entered into a text field in the Flash <acronym title="Integrated Development Environment">IDE</acronym></strong>.  However, this is not so when the <code>text</code> property of the TextField object is modified with ActionScript.  Essentially, this adds an unexpected character to text fields created in Flash&#8217;s <acronym title="Integrated Development Environment">IDE</acronym> that have not been modified with ActionScript, which can cause confusion if you are using ActionScript to work with text fields that have been placed on the stage.</p>
<p><span id="more-204"></span></p>
<p>The first step to understanding the problem is to create a text field in the Flash <acronym title="Integrated Development Environment">IDE</acronym> and take a look at its <code>text</code> property and how its characters are counted both before and after modifying it with ActionScript. Some example code is posted below (the first comment explains how to use it):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/**
* StringTest
* By Dan - http://thewebpageofdan.com
*
* To use this class, create a new Flash file with a text field and enter some text in
* it. Give it an instance name and change the textFieldInstance property of this class
* to that name.  Set this class as the &quot;Document class&quot; of the Flash file, then create
* the swf and run it.
*/</span>
<span style="color: #9900cc; font-weight: bold;">package</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">MovieClip</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.<span style="color: #004993;">TextField</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> StringTest extends <span style="color: #004993;">MovieClip</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> const textFieldInstance<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;blah_txt&quot;</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> StringTest<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #009900;">// Print out info on the text field's string</span>
			traceStringInfo<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>textFieldInstance<span style="color: #000000;">&#93;</span>.<span style="color: #004993;">text</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #009900;">// Remove the last character</span>
			<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>textFieldInstance<span style="color: #000000;">&#93;</span>.<span style="color: #004993;">text</span> = <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>textFieldInstance<span style="color: #000000;">&#93;</span>.<span style="color: #004993;">text</span>.<span style="color: #004993;">substring</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>textFieldInstance<span style="color: #000000;">&#93;</span>.<span style="color: #004993;">text</span>.<span style="color: #004993;">length</span> <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #009900;">// Print new info</span>
			traceStringInfo<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>textFieldInstance<span style="color: #000000;">&#93;</span>.<span style="color: #004993;">text</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		* Outputs string data
		*/</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> traceStringInfo<span style="color: #000000;">&#40;</span>string<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'--------------'</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'length: '</span> <span style="color: #000000; font-weight: bold;">+</span> string.<span style="color: #004993;">length</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'text: '</span> <span style="color: #000000; font-weight: bold;">+</span> string<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'--------------'</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Before changing the text of the text field with ActionScript the text value has a mysterious &#8220;ghost character&#8221; (carriage return) added to the end of it.  Strange, no?</p>
<p>Another thing to think about is if text fields in your Flash application are coming from an outside data source (like <acronym title="eXtensible Markup Language">XML</acronym>), which may be populated by external applications (such as a <acronym title="PHP: Hypertext Preprocessor">PHP</acronym>, Perl, or C++ script), which may be accepting data from users with different operating systems.  The reason why this is important is because carriage returns are different on Linux (&#8221;\n&#8221;), Mac (&#8221;\r&#8221;), and Windows (&#8221;\r\n&#8221;) and the application(s) that store this data may or may not be taking the operating system into consideration and storing it in a uniform way. Thus, it&#8217;s possible your Flash application may be importing data with values for text fields that may contain different character combinations that are meant to represent line breaks.</p>
<p>This made me think a bit more about extracting the exact number of characters in a text field.  I currently use this function/method to have strings with standard line breaks and no trailing white space:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/**
* Changes all line breaks to &quot;\n&quot; and removes trailing white space from a string.
* By Dan - http://thewebpageofdan.com
*/</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> fixString<span style="color: #000000;">&#40;</span>string<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #009900;">// Turn &quot;\r\n&quot; and &quot;\r&quot; into &quot;\n&quot;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> winLineBreaks<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">RegExp</span> = <span style="color: #000000; font-weight: bold;">/</span>\r\n<span style="color: #000000; font-weight: bold;">/</span>g; 
	<span style="color: #6699cc; font-weight: bold;">var</span> macLineBreaks<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">RegExp</span> = <span style="color: #000000; font-weight: bold;">/</span>\r<span style="color: #000000; font-weight: bold;">/</span>g; 
&nbsp;
	string.<span style="color: #004993;">replace</span><span style="color: #000000;">&#40;</span>winLineBreaks, <span style="color: #990000;">&quot;<span style="">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
	string.<span style="color: #004993;">replace</span><span style="color: #000000;">&#40;</span>macLineBreaks, <span style="color: #990000;">&quot;<span style="">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #009900;">// Trim trailing white space</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> whiteSpace<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">RegExp</span> = <span style="color: #000000; font-weight: bold;">/</span>\s<span style="color: #000000; font-weight: bold;">/</span>; 
	<span style="color: #0033ff; font-weight: bold;">while</span> <span style="color: #000000;">&#40;</span>string.<span style="color: #004993;">substring</span><span style="color: #000000;">&#40;</span>string.<span style="color: #004993;">length</span> <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span>, string.<span style="color: #004993;">length</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">search</span><span style="color: #000000;">&#40;</span>whiteSpace<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		string = string.<span style="color: #004993;">substring</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>, string.<span style="color: #004993;">length</span> <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">return</span> string;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>And of course, to those with more information: please enlighten us <img src='http://www.thewebpageofdan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thewebpageofdan.com/2008/11/25/actionscript-text-fields-have-extra-newlinescarriage-returns-n-and-r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActionScript Timer class seem offset/innaccurate/way off? It is!</title>
		<link>http://www.thewebpageofdan.com/2008/11/01/actionscript-timer-seem-class-innaccurateway-off-it-is/</link>
		<comments>http://www.thewebpageofdan.com/2008/11/01/actionscript-timer-seem-class-innaccurateway-off-it-is/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 02:21:20 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://localhost/dan/?p=165</guid>
		<description><![CDATA[Something I discovered a while ago has popped up in one of my old projects and I decided to share what I found. My Virtual Cube application, which renders interactive virtual Rubik&#8217;s cubes, uses timer to keep track of how long it takes a user to solve a scrambled cube. While using it, I noticed [...]]]></description>
			<content:encoded><![CDATA[<p>Something I discovered a while ago has popped up in one of my old projects and I decided to share what I found. My <a href="http://www.thewebpageofdan.com/2008/05/21/virtual-cube/">Virtual Cube</a> application, which renders interactive virtual Rubik&#8217;s cubes, uses timer to keep track of how long it takes a user to solve a scrambled cube. While using it, I noticed the timer running slower while using the 5&#215;5x5 cube and faster with the 2&#215;2x2 cube.  What would be three seconds while using the small cube would be six or seven seconds for the large cube.</p>
<p>What was happening was the frame rate was slowing down because the <a href="http://flashsandy.org/">Sandy 3D engine</a> (an ActionScript 3D engine I use to render the cube) was taking longer to render the larger, and more complex, cube and all of its &#8220;<a href="http://en.wikipedia.org/wiki/Rubik%27s_Cube#Workings">cubies</a>&#8221; that rotate.  But what makes it rather odd was that this slowdown in frame rate was affecting the timer the user saw in the application.  Because flash had to work harder (and longer) to display the more complex cube, it would take that much longer for my <code>TimerEvent.TIMER</code> event to dispatch and update my timer in the user interface.</p>
<p><span id="more-165"></span></p>
<p>To put it in a nutshell, <strong>the Timer class is not what you think it is</strong> (a perfect timer); it is actually influenced by the user&#8217;s frame rate.  Let&#8217;s take a look at what it says right in the documentation that can be found in the Flash Help book within Flash CS or at the <a href="http://livedocs.adobe.com/flex/2/langref/index.html?flash/utils/Timer.html">online Adobe® Flex™ 2 Language Reference</a>:</p>
<blockquote><p>
You can create Timer objects to run once or repeat at specified intervals to execute code on a schedule. <strong>Depending on the SWF file&#8217;s framerate</strong> or Flash Player&#8217;s environment (available memory and other factors), <strong>Flash Player may dispatch events at slightly offset intervals</strong>. For example, if a SWF file is set to play at 10 frames per second [fps], which is 100 millisecond intervals, but your timer is set to fire an event at 80 milliseconds, Flash Player will fire the event close to the 100 millisecond interval. Memory-intensive scripts may also offset the events.</p>
</blockquote>
<p><a href="http://flashquartermaster.com">Tom Coxen</a> has <a href="https://bugs.adobe.com/jira/browse/FP-34">reported this</a> &#8220;bug&#8221; a while ago and released some information regarding it, which I found to be a perfect solution to my problem.  Below is some code he posted to reproduce the bug:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/**
* Timer inacurracy example.
* See: https://bugs.adobe.com/jira/browse/FP-34
*
* Originally by Tox Coxen - http://flashquartermaster.com
* Slight modifications by Dan - http://thewebpageofdan.com
*/</span>
<span style="color: #9900cc; font-weight: bold;">package</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">MovieClip</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">TimerEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span>.<span style="color: #004993;">Timer</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span>.<span style="color: #004993;">getTimer</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> TimerTest extends <span style="color: #004993;">MovieClip</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _start<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>;
   		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _desiredDelay<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">1000</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> TimerTest<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">timer</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Timer</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Timer</span><span style="color: #000000;">&#40;</span>_desiredDelay<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">timer</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">TimerEvent</span>.<span style="color: #004993;">TIMER</span>, tick<span style="color: #000000;">&#41;</span>;
			_start = <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">timer</span>.<span style="color: #004993;">start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> tick<span style="color: #000000;">&#40;</span>evt<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TimerEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">timer</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Timer</span> = <span style="color: #004993;">Timer</span><span style="color: #000000;">&#40;</span>evt.<span style="color: #004993;">currentTarget</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> elapsed<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000;">&#40;</span><span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">-</span> _start<span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> desiredElapsed<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000;">&#40;</span><span style="color: #004993;">timer</span>.<span style="color: #004993;">currentCount</span> <span style="color: #000000; font-weight: bold;">*</span> _desiredDelay<span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = elapsed <span style="color: #000000; font-weight: bold;">-</span> desiredElapsed;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">offset</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">1000</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;MORE THAN A SECOND OFF!&quot;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Tick | Count: &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #004993;">timer</span>.<span style="color: #004993;">currentCount</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">&quot; / desired Elpased millis &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> desiredElapsed <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">&quot; / getTimer() elapsed millis: &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> elapsed <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">&quot; / offset: &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #004993;">offset</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Here are the results I get from running it:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;">Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">1000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">1059</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">59</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">2000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">2112</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">112</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">3</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">3000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">3175</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">175</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">4</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">4000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">4247</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">247</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">5</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">5000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">5311</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">311</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">6</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">6000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">6390</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">390</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">7</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">7000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">7463</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">463</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">8</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">8000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">8511</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">511</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">9</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">9000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">9559</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">559</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">10</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">10000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">10607</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">607</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">11</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">11000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">11671</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">671</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">12</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">12000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">12687</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">687</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">13</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">13000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">13689</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">689</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">14</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">14000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">14759</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">759</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">15</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">15000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">15767</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">767</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">16</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">16000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">16823</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">823</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">17</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">17000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">17871</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">871</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">18</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">18000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">18918</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">918</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">19</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">19000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">19927</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">927</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">20</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">20000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">20983</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">983</span>
MORE THAN A SECOND OFF<span style="color: #000000; font-weight: bold;">!</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">21</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">21000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">22038</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">1038</span>
MORE THAN A SECOND OFF<span style="color: #000000; font-weight: bold;">!</span>
Tick <span style="color: #000000; font-weight: bold;">|</span> Count<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">22</span> <span style="color: #000000; font-weight: bold;">/</span> desired elapsed millis <span style="color: #000000; font-weight:bold;">22000</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> elapsed millis<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">23119</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #004993;">offset</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">1119</span></pre></td></tr></table></div>

<p>Basically, what this demonstrates, is that as the Timer class &#8220;ticks&#8221; can become more and more inaccurate.  Personally, I think the Adobe needs to come up with a better solution for a timer with ActionScript because of how misleading this is to Flash developers using ActionScript 3.0, <em>even though</em> it is stated clearly in the documentation.  Luckily, Tom posted an ActionScript class with his bug report to use as a workaround.  A modified version, which I now use on all my Flash projects that require a &#8220;real&#8221; timer, is posted below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/**
* Workaround for Timer offsets
* See: https://bugs.adobe.com/jira/browse/FP-34
*
* Originally by Tox Coxen - http://flashquartermaster.com
* Edited by Dan - http://thewebpageofdan.com
*/</span>
<span style="color: #9900cc; font-weight: bold;">package</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span>.<span style="color: #004993;">Timer</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span>.<span style="color: #004993;">getTimer</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> TimerReal extends <span style="color: #004993;">Timer</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _desiredDelay<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _initStart<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>;
   		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _stop<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>;
   		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _start<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>;
   		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _pauses<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _offset<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>;
&nbsp;
		<span style="color: #3f5fbf;">/**
		* Constructs a new RealTimer object with the specified &lt;code&gt;delay&lt;/code&gt; and &lt;code&gt;repeatCount&lt;/code&gt; states. 
		* 
		* @param delay		The delay between timer events, in milliseconds. 
		* @param repeatCount	Specifies the number of repetitions. If zero, the timer repeats infinitely. If nonzero, the timer runs the specified number of times and then stops. 
		*/</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> TimerReal<span style="color: #000000;">&#40;</span><span style="color: #004993;">delay</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>, <span style="color: #004993;">repeatCount</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000000; font-weight:bold;">0.0</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			_desiredDelay = <span style="color: #004993;">delay</span>;
			_initStart = <span style="color: #000000; font-weight:bold;">0</span>;
			_start = <span style="color: #000000; font-weight:bold;">0</span>;
			_stop = <span style="color: #000000; font-weight:bold;">0</span>;
			_pauses = <span style="color: #000000; font-weight:bold;">0</span>;
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">delay</span>, <span style="color: #004993;">repeatCount</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		* Manages the timer drift and accounts for pauses caused by stopping and starting the Timer.
		*/</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> adjustDelay<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #009900;">// Aggregate pauses.</span>
			<span style="color: #009900;">// When start and stop are called internally in flash.utils.Timer _start will equal _stop</span>
			_pauses <span style="color: #000000; font-weight: bold;">+</span>= _start <span style="color: #000000; font-weight: bold;">-</span> _stop;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> elapsed<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000;">&#40;</span><span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">-</span> _initStart<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">-</span> _pauses;
			<span style="color: #6699cc; font-weight: bold;">var</span> desiredElapsed<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000;">&#40;</span><span style="color: #004993;">currentCount</span> <span style="color: #000000; font-weight: bold;">*</span> _desiredDelay<span style="color: #000000;">&#41;</span>;
			_offset = elapsed <span style="color: #000000; font-weight: bold;">-</span> desiredElapsed;
			<span style="color: #6699cc; font-weight: bold;">var</span> newDelay<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = _desiredDelay <span style="color: #000000; font-weight: bold;">-</span> _offset;
&nbsp;
			<span style="color: #009900;">// Setting negetive values for delay will cause an error</span>
			<span style="color: #004993;">delay</span> = <span style="color: #000000;">&#40;</span>newDelay <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">?</span> newDelay <span style="color: #000000; font-weight: bold;">:</span> _desiredDelay;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		* @private
		*/</span>
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #009900;">// Set _initStart once only otherwise set a value for when Timer.start() is called</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>_initStart == <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				_initStart = <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span>
			<span style="color: #000000;">&#123;</span>
				_start = <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span>.<span style="color: #004993;">start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		* @private
		*/</span>
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #009900;">// Only set the stop value if the Timer has been started and needs to be stopped i.e. is running</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>_initStart <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #004993;">running</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				_stop = <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span>.<span style="color: #004993;">stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		* @private
		*/</span>
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">reset</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			_initStart = <span style="color: #000000; font-weight:bold;">0</span>;
			_start = <span style="color: #000000; font-weight:bold;">0</span>;
			_stop = <span style="color: #000000; font-weight:bold;">0</span>;
			_pauses = <span style="color: #000000; font-weight:bold;">0</span>;
			<span style="color: #0033ff; font-weight: bold;">super</span>.<span style="color: #004993;">reset</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		* The desired delay.
		*/</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> desiredDelay<span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			_desiredDelay = <span style="color: #004993;">value</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		* The current offset.
		*/</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> <span style="color: #004993;">offset</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> _offset;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>This class keeps track of how much &#8220;real&#8221; time is passing while the timer is running by using the <code>getTimer()</code> function.  The <code>adjustDelay()</code> method computes the offset and adjusts the <code>delay</code> property.  Here is an example of how you could use the class:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/**
* TimerReal example.
* By Dan - http://thewebpageofdan.com
*/</span>
<span style="color: #9900cc; font-weight: bold;">package</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">MovieClip</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">TimerEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span>.<span style="color: #004993;">Timer</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span>.<span style="color: #004993;">getTimer</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> TimerRealExample extends <span style="color: #004993;">MovieClip</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> TimerRealExample<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">timer</span><span style="color: #000000; font-weight: bold;">:</span>TimerReal = <span style="color: #0033ff; font-weight: bold;">new</span> TimerReal<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">timer</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">TimerEvent</span>.<span style="color: #004993;">TIMER</span>, tick<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">timer</span>.<span style="color: #004993;">start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> tick<span style="color: #000000;">&#40;</span>evt<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TimerEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			TimerReal<span style="color: #000000;">&#40;</span>evt.<span style="color: #004993;">currentTarget</span><span style="color: #000000;">&#41;</span>.adjustDelay<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> timeStr<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = millisToTimeStr<span style="color: #000000;">&#40;</span>evt.<span style="color: #004993;">target</span>.<span style="color: #004993;">currentCount</span> <span style="color: #000000; font-weight: bold;">+</span> evt.<span style="color: #004993;">target</span>.<span style="color: #004993;">offset</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>timeStr<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		* Converts milliseconds to a time string
		*/</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> millisToTimeStr<span style="color: #000000;">&#40;</span><span style="color: #004993;">milliseconds</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">seconds</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #004993;">Math</span>.<span style="color: #004993;">floor</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">milliseconds</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">100</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">minutes</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #004993;">Math</span>.<span style="color: #004993;">floor</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">seconds</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">60</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">hours</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #004993;">Math</span>.<span style="color: #004993;">floor</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">minutes</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">60</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> lminutes<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #004993;">minutes</span> <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">hours</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">60</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> lseconds<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #004993;">seconds</span> <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">minutes</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">60</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> lmilliseconds<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #004993;">milliseconds</span> <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #004993;">seconds</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">100</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> millisecondsStr<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #000000;">&#40;</span>lmilliseconds <span style="color: #000000; font-weight: bold;">&gt;</span>= <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span>lmilliseconds<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;0&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> lmilliseconds;
			<span style="color: #6699cc; font-weight: bold;">var</span> secondsStr<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #000000;">&#40;</span>lseconds <span style="color: #000000; font-weight: bold;">&gt;</span>= <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span>lseconds<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;0&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> lseconds;
			<span style="color: #6699cc; font-weight: bold;">var</span> minutesStr<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #000000;">&#40;</span>lminutes <span style="color: #000000; font-weight: bold;">&gt;</span>= <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span>lminutes<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;0&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> lminutes;
			<span style="color: #6699cc; font-weight: bold;">var</span> hoursStr<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #000000;">&#40;</span><span style="color: #004993;">hours</span> <span style="color: #000000; font-weight: bold;">&gt;</span>= <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">hours</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;0&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #004993;">hours</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">hours</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">?</span> hoursStr <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">&quot;:&quot;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">+</span> minutesStr <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">&quot;:&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> secondsStr <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">&quot;.&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> millisecondsStr<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p><strong>Note:</strong> It&#8217;s important to remember that the Timer class&#8217;s <code>TimerEvent.TIMER</code> event will still dispatch at incorrect intervals, but this fix will help to adjust its <code>currentCount</code> property.  If anyone dives deeper into this, let me know what you find!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thewebpageofdan.com/2008/11/01/actionscript-timer-seem-class-innaccurateway-off-it-is/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Help Book Creator</title>
		<link>http://www.thewebpageofdan.com/2008/06/23/flash-help-book-creator/</link>
		<comments>http://www.thewebpageofdan.com/2008/06/23/flash-help-book-creator/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 18:13:18 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Flash/ActionScript]]></category>
		<category><![CDATA[Portfolio updates]]></category>

		<guid isPermaLink="false">http://www.thewebpageofdan.com/news/?p=13</guid>
		<description><![CDATA[Flash Help Book Creator is a tool to create a Flash extension for an ActionScript library that adds a help book to Flash Help and adds syntax highlighting and code hints to the editor. It started out as something solely for the Sandy 3D engine, but I decided to make it public since it&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.thewebpageofdan.com/portfolio/flash-help-book-creator/">Flash Help Book Creator</a> is a tool to create a Flash extension for an ActionScript library that adds a help book to Flash Help and adds syntax highlighting and code hints to the editor. It started out as something solely for the <a href="http://www.flashsandy.org">Sandy 3D engine</a>, but I decided to make it public since it&#8217;s a helpful application that others may find useful.  If you have an ActionScript library that you support, this is what will integrate your code into the Flash <acronym title="Integrated Development Environment">IDE</acronym>. So be sure to give it a try.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thewebpageofdan.com/2008/06/23/flash-help-book-creator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebDevPage: A helpful page for web developers</title>
		<link>http://www.thewebpageofdan.com/2008/05/27/webdevpage-a-helpful-page-for-web-developers/</link>
		<comments>http://www.thewebpageofdan.com/2008/05/27/webdevpage-a-helpful-page-for-web-developers/#comments</comments>
		<pubDate>Tue, 27 May 2008 15:21:16 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Portfolio updates]]></category>

		<guid isPermaLink="false">http://www.thewebpageofdan.com/news/?p=12</guid>
		<description><![CDATA[I decided to make WebDevPage public.  It is something I&#8217;ve used for a while for determining information about users&#8217; browsers and installed plugins.  To make it more useful to the public, I added a listing of links that I have found as useful web development resources.  Let me know if there are any problems with [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to make <a href="http://www.thewebpageofdan.com/portfolio/webdevpage/">WebDevPage</a> public.  It is something I&#8217;ve used for a while for determining information about users&#8217; browsers and installed plugins.  To make it more useful to the public, I added a listing of links that I have found as useful web development resources.  Let me know if there are any problems with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thewebpageofdan.com/2008/05/27/webdevpage-a-helpful-page-for-web-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual cube</title>
		<link>http://www.thewebpageofdan.com/2008/05/21/virtual-cube/</link>
		<comments>http://www.thewebpageofdan.com/2008/05/21/virtual-cube/#comments</comments>
		<pubDate>Wed, 21 May 2008 17:39:50 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Flash/ActionScript]]></category>
		<category><![CDATA[Games/Puzzles]]></category>
		<category><![CDATA[Portfolio updates]]></category>

		<guid isPermaLink="false">http://www.thewebpageofdan.com/news/?p=11</guid>
		<description><![CDATA[Virtual cube is something I finished a little while ago and have been revisiting every now and then, but I think it&#8217;s time to finally post it.
The application is a virtual cube (basically a Rubik&#8217;s cube).  It displays a cube that the user can manipulate by rotating both the cube itself and its different [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.thewebpageofdan.com/portfolio/virtual-cube/">Virtual cube</a> is something I finished a little while ago and have been revisiting every now and then, but I think it&#8217;s time to finally post it.</p>
<p>The application is a virtual cube (basically a Rubik&#8217;s cube).  It displays a cube that the user can manipulate by rotating both the cube itself and its different levels.  I have included support for different cube sizes and a few different scramble methods.</p>
<p>Currently the &#8220;solver,&#8221; it&#8217;s fake <img src='http://www.thewebpageofdan.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  .  It simply retraces the rotations of the user (as well as the scrambler) to return the cube to its solved state.  I know someone who is making a solver that will solve any size cube (NxNxN) in Java, which I will port to ActionScript and incorporate in this application.  This will also allow me to make a feature where the user can &#8220;paint&#8221; the cube by individually placing the stickers on the cube since the solver will then be able to solve a cube without needing to know the rotations it takes to get to that permutation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thewebpageofdan.com/2008/05/21/virtual-cube/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>An update?!</title>
		<link>http://www.thewebpageofdan.com/2008/05/20/an-update/</link>
		<comments>http://www.thewebpageofdan.com/2008/05/20/an-update/#comments</comments>
		<pubDate>Tue, 20 May 2008 21:22:21 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Portfolio updates]]></category>

		<guid isPermaLink="false">http://www.thewebpageofdan.com/news/?p=10</guid>
		<description><![CDATA[It almost took a year, but here I am, alive and posting.  School is out now, so I will be cleaning up my portfolio and posting some of the things I&#8217;ve been working on.  Some of them are already up and running online, let me know if there are problems.  
]]></description>
			<content:encoded><![CDATA[<p>It almost took a year, but here I am, alive and posting.  School is out now, so I will be cleaning up my portfolio and posting some of the things I&#8217;ve been working on.  Some of them are already up and running online, let me know if there are problems. <img src='http://www.thewebpageofdan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thewebpageofdan.com/2008/05/20/an-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New game: Tetris</title>
		<link>http://www.thewebpageofdan.com/2007/08/11/new-game-tetris/</link>
		<comments>http://www.thewebpageofdan.com/2007/08/11/new-game-tetris/#comments</comments>
		<pubDate>Sun, 12 Aug 2007 02:36:59 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Flash/ActionScript]]></category>
		<category><![CDATA[Games/Puzzles]]></category>
		<category><![CDATA[Portfolio updates]]></category>

		<guid isPermaLink="false">http://www.thewebpageofdan.com/news/2007/08/11/new-game-tetris/</guid>
		<description><![CDATA[Tetris is one of those games that I just had to make&#8230;because I can&#8230;and I did! I tried putting in a few different game modes and will probably add some more in the future as well as more challenges.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://thewebpageofdan.com/portfolio/tetris/">Tetris</a> is one of those games that I just had to make&#8230;because I can&#8230;and I did! I tried putting in a few different game modes <span style="text-decoration: line-through;">and will probably add some more in the future as well as more challenges</span>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thewebpageofdan.com/2007/08/11/new-game-tetris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
