thx 

--- On Mon, 8/29/11, Kerry Thompson <al...@cyberiantiger.biz> wrote:

From: Kerry Thompson <al...@cyberiantiger.biz>
Subject: Re: [Flashcoders] loop and Timer problem?????????
To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com>
Date: Monday, August 29, 2011, 6:28 PM

The timer isn't completely independent. If there is code executing when it is 
time for the timer to fire, the timer has to wait until the code finishes. 
Loops are notorious CPU hogs--nothing else can happen until the loop finishes.

Cordially,

Kerry Thompson

On Aug 29, 2011, at 3:27 PM, nasim hhhhh <iranebah...@yahoo.com> wrote:

> I Cant understannnnnnnnnnnnd
> why is that
> when the timer start it should work independence any thing 
> but it wait for finish th loop
> can u explain the timer and loop i know them but i cant understand how they 
> work and has an effect on cpu
> 
> --- On Mon, 8/29/11, Cor <c...@chello.nl> wrote:
> 
> From: Cor <c...@chello.nl>
> Subject: RE: [Flashcoders] loop and Timer problem?????????
> To: "'Flash Coders List'" <flashcoders@chattyfig.figleaf.com>
> Date: Monday, August 29, 2011, 2:44 PM
> 
> TRY THIS:
> 
> 
> var forsate,generalFlag:Boolean;
> var counter:int=0;
> var generalTimer:Timer=new Timer(1);
> generalTimer.addEventListener(TimerEvent.TIMER,generalfunc);
> 
> //NOW IT IS SET
> //UN COMMENT THE LINE BELOW TO NOTICE THE DIFFENCE
> //generalFlag=true;
> 
> testhalgheh();
> 
> function generalfunc(e:TimerEvent=null):void {
>     generalFlag=true;
>     //trace( " generalFlag " + generalFlag)
> }
> 
> function testhalgheh():void {    
>     generalTimer.start();
>     //generalFlag IS FALSE AT THIS MOMENT, BECAUSE THE generalfunc IS NOT YET 
>CALLED
>     while (counter<1000) {
>         if (generalFlag==true) {
>             trace("hello");
>             counter++;
>         }
>     }
> }
> 
> 
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to