Flex different behaviour when expanding and shrinking browser window
I am having component, which resizes with respect to browser window. Initially I was redrawing it like this:
override protected function updateDisplayList(unscaledWidth, unscaledHeight):void
{
if(_draw)
{
...........
draw(unscaledWidth, unscaledHeight)
}
},
where _draw depends on whether width, height or dataProvider changes. It draws too much, though (lots of redraws from initial to final width/height). I added timer then:
_timer = new Timer(_delay);
override protected function updateDisplayList(unscaledWidth, unscaledHeight):void
{
if(_draw)
{
...........
_timer.reset();
_timer.start();
}
},
where handler of Timer event stops the timer and does the drawing. It works fine while I am increasing the size of the browser, but draws things immediately when I decrease it(browser window). Any ideas?
链接地址: http://www.djcxy.com/p/34602.html下一篇: 展开和缩小浏览器窗口时展现不同的行为