AS2, AS3 .
, as2, , 100 , , . getTimer(), , , , . , 99% . , 100 .
, Timer AS3, , , .
, , , .
, , , getTimer 1000, 2002, 3002.
2 , , 4 , 2 , 1000 , . , , 2 + 2 = 4, , .
: var delay: int = 1000;
var myTimer:Timer = new Timer(delay, 0);
function timerHandler($evt:TimerEvent){
trace(getTimer());
}
myTimer.addEventListener(TimerEvent.TIMER, timerHandler);
myTimer.start();
trace(getTimer());
:
15011
16011
17011
18054
19054
20054
21054
22054
23057
24054
25054
26054
27054
28011
29011
30011
31011
...
135047
136194 <- big one here
137246 - and here
138167 -
139242 -
140173 -
141016 <- back
142018 <- normalized
143018
144018
145019
146018
147018
It is interesting to see this "normalization." Sometimes it turns off for 54 ms, and then switches to 27 ms, and then up to 18 ms, etc. And it stays there for a while until it normalizes around another value. But this value is not cumulative, but rather close to the base. i.e. the displacement does not continue to grow. You would see a cumulative difference if you repeatedly created an event for one use.