Groups | Blog | Home
all groups > flash actionscript > february 2007 >

flash actionscript : Timer Problem



leoserra
2/21/2007 11:58:45 PM
Hi all,

Hope You can help me. I'm finishing a physics simulation, wich results are
going to a Datagrid.

I have a counter variable that stores a value to control a stopwatch. This
stopwatch, you have the possibility to change the velocity in wich that times
goes(1x, 2x, 4x & 8x).

I want that each 30s a value is stored in the datagrid. I've done that, but
the value is store 24 times in the datagrid because that's my frame rate. Every
attempts to correct this have failed for me. I'll show you my last attempt:

if((_global.time%30)==0 && counter==24){

_root.graphic_mc.my_ft.addItem({Time:_parent.time_tx.text,Temperature:_parent.te
mperature_tx.text});
_root.upTime.push(_parent.time_tx.text);
_root.upTemperature.push(_parent.temperature_tx.text);
counter=0;
}

I also tried by calculation elapsed time, but with no result.

Basicaly I want one value everytime that _global.time counts 30 seconds, and
not 24 values.

Anyone think of a solution? I'm starting to get dizzy with this :S

Thanks,
Leonel

kglad
2/22/2007 5:19:13 AM
AddThis Social Bookmark Button