Hi
I am student , I’m new in flash .In My Project I need to
have  timer that work correctly with out
depending on other  process in my project
. Please look at the attachment  , one
timer worl alone another work and have condition , when we get the condition
the timers work slowly , I don’t know why is that and how can I solve it and
have independent  timer . I test it when
we need to work with loop or other thing the timer stop working even the timers
that aren’t related to it ?????????????????
 

I have foure text box inside stage (i cant attach file because of limited size 
in site)


import flash.utils.Timer;
import flash.events.TimerEvent;
var i :int
var flagloop:Boolean=false;
var step:Number=0
var startTime :Number=getTimer()
var timer1:Timer=new Timer(1)
timer1.start()
timer1.addEventListener(TimerEvent.TIMER,Func_time1)
function Func_time1(e:TimerEvent):void
{
    timer1txt.text=String(step)
    step +=0.001
    
    
}

/////Timer 2vvvvvvvvvvvv
var timer2:Timer=new Timer(1)
timer2.start()
timer2.addEventListener(TimerEvent.TIMER,Func_time2)
function Func_time2(e:TimerEvent):void
{
    timer2txt.text=e.target.currentCount
    gettimertxt.text=String((getTimer()- startTime))
    //e.updateAfterEvent();
    flagloop=true
}
//vvvvvvvvvvvvvvvvvv/////Timer 2
var timer3:Timer=new Timer(1)
timer3.start()
timer3.addEventListener(TimerEvent.TIMER,Func_time3)
function Func_time3(e:TimerEvent):void
{
    timer3txt.text=e.target.currentCount
    if((step>2) && (step<2.25))
    {
        if(flagloop== true)
        {
            testTimer()
        }
        
    }
    
}

///////vvvvvvvvvv////
function testTimer():void
{
    flagloop=false
    for(i=0;i<1000;i++)
    {
        trace("Hello World")
    }
    flagloop=true
}
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to