Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

frame drop independend script?

Contributor ,
Apr 08, 2013 Apr 08, 2013

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

TOPICS
ActionScript
500
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 08, 2013 Apr 08, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Apr 08, 2013 Apr 08, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 09, 2013 Apr 09, 2013
LATEST

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 ...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines