Skip to main content
April 8, 2013
Question

frame drop independend script?

  • April 8, 2013
  • 2 replies
  • 547 views

I tried to run a script with setInterval within an exact time interval but if the interval is smaller than the frame time (even if fps are set highter) when framedrops occur the script does not seem to be executed early enough.

Is there a more decent way to have a script executed exactly every X number of milliseconds?

TIA

This topic has been closed for replies.

2 replies

Inspiring
April 8, 2013

Keeping track of time in AS3 is not a straightforward thing. AS3 is obviously not built as a language that targets mathematicians or physicists but gamedevelopers and designers.

If you want to have precise timing you will have to dig deeper.

Here is a series of articles that might be interesting for you.

April 9, 2013

I made a check to see if there is any difference when using a EnterFrame Event, setInterval and a Timer object in a MovieClip that has framedrops. But it seems that there is no way to execute a script earlier than a frame script.

Edit: My problem is that I want to interpolate an input value from a tcpip soucre. And when I got frame drops the movement on screen is stuttering.

I heard the is the possibility of using a thread in flash ...

Ned Murphy
Legend
April 8, 2013

I believe the Timer class is more reliable as a timing element.