hi,
ok listen i posted here before and i got an answer but my client changed his mind (annoying) and now i have another question…
what i want to do is to set a timer that counts 5 seconds back…
if u press the letter “r” it will stop the timer and tell what your reaction time was… so what i did is created a dynamic text field
and gave it a var name of tText and here is the code:
var nNum:Number = 5;
var mNum:Number = nNum;
tText = "Time left: "+nNum+" Seconds";
function mCount():Void {
if (nNum>=1) {
nNum--;
}
tText = "Time left: "+nNum+" Seconds";
if (nNum<=0) {
clearInterval(mInter);
tText = "Time is up!!!!!";
}
}
var mInter:Number = setInterval(mCount, 1000);
this.onEnterFrame = function() {
if (Key.isDown(82)) {
if (nNum>=1) {
clearInterval(mInter);
tText = "It took you: "+(mNum-nNum)+" Seconds";
delete this.onEnterFrame;
}
}
};
so that works fine…
BUT
he wants to send the info to an external database and spread it as xml (the reaction time[god knows what for])!
any ideas guys? :-/
thanks in advance…