<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Creating timers using the Timer class</title>
	<link>http://blog.flexexamples.com/2008/02/20/creating-timers-using-the-timer-class/</link>
	<description>A bunch of examples for Adobe Flex and ActionScript</description>
	<pubDate>Thu, 08 Jan 2009 12:21:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: Douglas querubin</title>
		<link>http://blog.flexexamples.com/2008/02/20/creating-timers-using-the-timer-class/#comment-17144</link>
		<author>Douglas querubin</author>
		<pubDate>Tue, 02 Dec 2008 21:14:28 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/02/20/creating-timers-using-the-timer-class/#comment-17144</guid>
		<description>hello, I have a timer, most do not understand much of AS3, I would like to create with an external file .as to please if someone wants to help me would be very grateful. 

meumaiil@hotmail.com</description>
		<content:encoded><![CDATA[<p>hello, I have a timer, most do not understand much of AS3, I would like to create with an external file .as to please if someone wants to help me would be very grateful. </p>
<p><a href="mailto:meumaiil@hotmail.com">meumaiil@hotmail.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: saul</title>
		<link>http://blog.flexexamples.com/2008/02/20/creating-timers-using-the-timer-class/#comment-17088</link>
		<author>saul</author>
		<pubDate>Mon, 01 Dec 2008 19:25:00 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/02/20/creating-timers-using-the-timer-class/#comment-17088</guid>
		<description>@Peter,

I managed to fix my previous problems with an IFrame - you know me well!

Because i use transitions between states i needed a timer to wait and fire a complete event once the transition had completed, which is based on time also. Peter this example was very easy to modify and works perfectly.

You are the man Peter, thanks for saving us newbies and getting us there quicker.

Faith restored.</description>
		<content:encoded><![CDATA[<p>@Peter,</p>
<p>I managed to fix my previous problems with an IFrame - you know me well!</p>
<p>Because i use transitions between states i needed a timer to wait and fire a complete event once the transition had completed, which is based on time also. Peter this example was very easy to modify and works perfectly.</p>
<p>You are the man Peter, thanks for saving us newbies and getting us there quicker.</p>
<p>Faith restored.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Galahady</title>
		<link>http://blog.flexexamples.com/2008/02/20/creating-timers-using-the-timer-class/#comment-13453</link>
		<author>Galahady</author>
		<pubDate>Mon, 16 Jun 2008 16:34:59 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/02/20/creating-timers-using-the-timer-class/#comment-13453</guid>
		<description>Dear Peterd,

Thx for your prompt response! 

This time i'm not prudent engough. You are right. It's not the timer's fault, although i can reproduce the same issue again and again.

After several experiments, i guess the totalMemory might be the total amount of memory used by all Flash Player instances in the current browser process.

Thx again~!

Yours sincerely, Galahady.</description>
		<content:encoded><![CDATA[<p>Dear Peterd,</p>
<p>Thx for your prompt response! </p>
<p>This time i&#8217;m not prudent engough. You are right. It&#8217;s not the timer&#8217;s fault, although i can reproduce the same issue again and again.</p>
<p>After several experiments, i guess the totalMemory might be the total amount of memory used by all Flash Player instances in the current browser process.</p>
<p>Thx again~!</p>
<p>Yours sincerely, Galahady.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2008/02/20/creating-timers-using-the-timer-class/#comment-13414</link>
		<author>peterd</author>
		<pubDate>Sun, 15 Jun 2008 04:30:25 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/02/20/creating-timers-using-the-timer-class/#comment-13414</guid>
		<description>Galahady,

Unfortunately I cannot reproduce the issue.
Using the following code my total memory jumped from 5152768 to 5169152, where it stayed fairly steady:
&lt;pre class="code"&gt;
&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init();"&#62;
    
    &#60;mx:Script&#62;
        &#60;![CDATA[
            private var timer:Timer;
            
            private function init():void {
                timer = new Timer(1000);
                timer.addEventListener(TimerEvent.TIMER, timer_timer);
                timer.start();
            }
            
            private function timer_timer(evt:TimerEvent):void {
                lblTotalMemory.text = new Date().toTimeString() + ": " + String(System.totalMemory);
            }
        ]]&#62;
    &#60;/mx:Script&#62;
    
    &#60;mx:Label id="lblTotalMemory" /&#62;
    
&#60;/mx:Application&#62;
&lt;/pre&gt;

I'm not 100% certain if the &lt;code&gt;totalMemory&lt;/code&gt; property returns the amount of memory (in bytes) used by the *current* Flash Player instance for the specific Flex application, or if it returns the amount of memory used by *all current* Flash Player instances. Meaning, your numbers may not be what you expect if you have other Flash Player instances running in the background which may be doing animations or calculations or serving advertisements or whatever.

Peter</description>
		<content:encoded><![CDATA[<p>Galahady,</p>
<p>Unfortunately I cannot reproduce the issue.<br />
Using the following code my total memory jumped from 5152768 to 5169152, where it stayed fairly steady:</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private var timer:Timer;

            private function init():void {
                timer = new Timer(1000);
                timer.addEventListener(TimerEvent.TIMER, timer_timer);
                timer.start();
            }

            private function timer_timer(evt:TimerEvent):void {
                lblTotalMemory.text = new Date().toTimeString() + ": " + String(System.totalMemory);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Label id="lblTotalMemory" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>I&#8217;m not 100% certain if the <code>totalMemory</code> property returns the amount of memory (in bytes) used by the *current* Flash Player instance for the specific Flex application, or if it returns the amount of memory used by *all current* Flash Player instances. Meaning, your numbers may not be what you expect if you have other Flash Player instances running in the background which may be doing animations or calculations or serving advertisements or whatever.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Galahady</title>
		<link>http://blog.flexexamples.com/2008/02/20/creating-timers-using-the-timer-class/#comment-13411</link>
		<author>Galahady</author>
		<pubDate>Sat, 14 Jun 2008 21:17:22 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/02/20/creating-timers-using-the-timer-class/#comment-13411</guid>
		<description>Dear Peterd,
			
   First, let me thank you with all my heart for your great blog! it really helps me a lot, and makes my programming in flex become a joyful experience. :)

   I have a question about the memory usage of the Timer control. When i create
a time with the following code snippet, i can see the total memory used by the
flay payer going up and up, steadily, at the speed of 30K~10K per second. 
   
   what's wrong? did i make something wrong or it is a bug of flex?

   thx in advance. 
   
   regards
   Galahady
 		
   p.s:			
			
&lt;pre class="code"&gt;
private var timer:Timer;

private function init():void {
    timer = new Timer(1000);
    timer.addEventListener(TimerEvent.TIMER, timer_timer);
    timer.start();
}

private function timer_timer(evt:TimerEvent):void {
    lblTotalMemory.text = String(System.totalMemory);
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Dear Peterd,</p>
<p>   First, let me thank you with all my heart for your great blog! it really helps me a lot, and makes my programming in flex become a joyful experience. :)</p>
<p>   I have a question about the memory usage of the Timer control. When i create<br />
a time with the following code snippet, i can see the total memory used by the<br />
flay payer going up and up, steadily, at the speed of 30K~10K per second. </p>
<p>   what&#8217;s wrong? did i make something wrong or it is a bug of flex?</p>
<p>   thx in advance. </p>
<p>   regards<br />
   Galahady</p>
<p>   p.s:			</p>
<pre class="code">
private var timer:Timer;

private function init():void {
    timer = new Timer(1000);
    timer.addEventListener(TimerEvent.TIMER, timer_timer);
    timer.start();
}

private function timer_timer(evt:TimerEvent):void {
    lblTotalMemory.text = String(System.totalMemory);
}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: dormouse</title>
		<link>http://blog.flexexamples.com/2008/02/20/creating-timers-using-the-timer-class/#comment-7106</link>
		<author>dormouse</author>
		<pubDate>Thu, 21 Feb 2008 02:00:30 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/02/20/creating-timers-using-the-timer-class/#comment-7106</guid>
		<description>peter

happy 元宵节(sweet dumplings made of glutinous rice flour, chinese festival).
thanks for your all examples, they are very good. And i can learn a lot in your website
best wishes to you. :)

dormouse</description>
		<content:encoded><![CDATA[<p>peter</p>
<p>happy 元宵节(sweet dumplings made of glutinous rice flour, chinese festival).<br />
thanks for your all examples, they are very good. And i can learn a lot in your website<br />
best wishes to you. :)</p>
<p>dormouse</p>
]]></content:encoded>
	</item>
</channel>
</rss>
