作者:KTone | 来源:互联网 | 2023-05-19 11:42
Wouldanyoneknowamethod(ortrick)toforcearenderingupdatetoanMXProgressBarinmanualmod
Would anyone know a method (or trick) to force a rendering update to an MX ProgressBar in manual
mode when using setProgress
?
在使用setProgress时,是否有人知道在手动模式下强制渲染更新到MX ProgressBar的方法(或技巧)?
I have a situation with a block of code containing a couple of for
loops which take a bit of time to complete. It would be tedious to unwrap this code to generate events, etc.
我有一个包含一些for循环的代码块的情况,这需要一些时间来完成。解包此代码以生成事件等将是繁琐的。
Update
Let me expand on this with a bit of pseudo code. I want to update the progress bar during operations on the contents of an array. THe for
loops blocks so the screen isn't updating. I've tried validateNow()
but that had no effect.
让我用一些伪代码扩展它。我想在操作数组内容期间更新进度条。对于循环阻止,屏幕不会更新。我已经尝试过validateNow()但是没有效果。
Is there some non-convoluted way I can either unwrap the for
loop or use AS3's event model to update a progress bar? (I'm more accustomed to multi-threaded environments where this sort of task is trivial).
是否有一些非复杂的方法我可以打开for循环或使用AS3的事件模型来更新进度条? (我更习惯于这种任务微不足道的多线程环境)。
private function doSomeWork():void {
progressBar.visible = true;
for(var n = 0; n
2 个解决方案