开发者

Render between two lines of code

I have a huge code execution with many loops and pre-rendering processes and I was wondering if there is a way to tell the flash player to take a little pause on the code side and do a render.

Basically I have my execusion that takes a while, and on each step I make a call to a screen and then modify the scale of开发者_运维知识库 a loading bar. Now the problem is that the user only sees the progress at the end, I know this is due to the fact that flash does code execution and then render, i tried to make calls to stage.invalidate to force a render but it wouldnt work until the whole execusion if finished either. Is there a way to force flash to render between two lines of code?


I encountered a similar problem in which my AS code would be running for a long time and the UI was getting unresponsive. So I implemented my logic as a Green Thread.

Check out this link for an as3 implementation and examples.


UIComponent has a rendering "framework" built into it. All display objects extend from it.
This will allow you to optimize your code, by using the invalidate methods.


You will want to familiarize yourself with pseudo-threads.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜