Forcing Flex to update the screen?

前端 未结 6 1817
梦谈多话
梦谈多话 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:06

    Try calling invalidateDisplayList() after each changes to your progress bar. Something like :

    Class StatusBar
    {
    
        public function set progress(value:uint):void
        {
            progressBar.value = value;
            progressBar.invalidateDisplayList();
        }
    }
    

    Flex has an invalidation cycle that avoid screen redrawing everytime a property changes. As an example, if a property's value changes 3 times in a single frame, it will render only with the last value set. You can force a component to be redrawn by calling invidateDisplayList() which means updateDisplayList will be immediatly executed instead of waiting the next frame.

提交回复
热议问题