Forcing Flex to update the screen?

前端 未结 6 1734
梦谈多话
梦谈多话 2021-01-05 05:28

This may be a bit of a beginners question, but I can\'t for the life of me figure it out.

I\'m using flex to develop a GUI for a large project, specifically a status

6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-05 06:11

    As mentioned in other answers, the flash player is single threaded, if you don't break up your work into discrete chunks that can be executed in separate "frames", you're going to see jumps and stutters in the ui, which is effectively what you're seeing.

    If you really must see that 12% message, then it's not enough to invalidate the display list, as the display list isn't getting a chance to update until after the 56% work has completed, you must explicitly interrupt the natural event cycle with a call to validateNow() after your message has been set.

    This however is not the best way to do things if performance is of concern. You might get by with judicial usage of callLater() to schedule each chunk of work in turn, as this will allow the player to potentially complete a frame cycle (and update the display list) before attempting the next step in your process.

提交回复
热议问题