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

Allowing the movie to run during complex code execution

New Here ,
Jul 16, 2009 Jul 16, 2009

Hello,

I have this complex XML processing code that builds up thousands of objects on stage. This might take some time. Perhaps not that big time to bring up that message about slow code execution, however signifficant enough to cause interface uncomfortabilities.

I understand very well that I can restructure my code in order to save all contextual variables, all counters in an object that is passed down to onEnterFrame events that process it a little bit and then pass it further, until the job is done.

However, before I go into dissecting my code, I wanted to make sure if there really is not a way how tom tell flash player do it's frame rendering routine while a complex code is executed in background (without splitting it up).

Thanks!

TOPICS
ActionScript
330
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
Explorer ,
Jul 28, 2009 Jul 28, 2009
LATEST

No, unfortunately, Flash player is not able to run something on a seperate thread while code is currently executing (the player will just lock up if the code execution takes longer than a certain amount of time and you'll get the dreaded "A script is causing the player to run slowly" dialog).  People have done work to do something similar to what you are trying to do, but ultimately, it comes down to running an ENTER_FRAME event or timer to break up the code execution.

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