try using undocumented setTimeOut or setInterval instead


say you have a function foo
with setInterval:

var secondsToWait:Number= 20*1000 //20 seconds
var interval_ID:Number=setInterval(this,"foo",20000)

function foo()
{
clearInterval(interval_ID);
trace("llegamos con setInterval");
}

with setTimeOut

setTimeout(this,foo,1000)
function foo()
{
  trace("llegamos con setTimeOut");
}

On 3/24/07, Gustavo Duenas <[EMAIL PROTECTED]> wrote:

Hi, I'm trying to set a timer to trigger a event after 20 seconds or
less, but so far i have this code, but with no results
someone help me? .
I don't know how could I got into but some help might be needed


this is the code: is inside the first frame of a movie clip and the 4
frame has: gotoAndPlay(1);


var now = getTimer();
var seconds:Number = now/1000;
var later:Number = seconds+20;
this.onEnterFrame= function (){
        if(seconds == later){
                trace("llegamos");

        }
}
trace(seconds);



Regards


Gustavo Duenas



_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
Yehia Shouman
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to