0 Replies Latest reply on Mar 9, 2010 12:16 PM by REM018

    MenuBar flickers/refreshes when enabled/disabled changes




      I am using a MenuBar with an XMLList as data source, which is defined in MXML. Something like this:


              <mx:MenuBar id="uiMenu" labelField="@label" iconField="@icon" itemClick="menuItemSelected(event)">

                  <mx:XMLList id="uimenuList">

                      <menuitem label="Menu 1" enabled="true">

                          <menuItem label="SubMenu 1" enabled="{obj != null ? obj.isEnabled: false}" />

                          <menuItem label="SubMenu 2" enabled="{someObj.isValid &amp;&amp; otherObj.isValid}" />




      I am binding the enabled properties to bindable variables of my objects that are available to this control. My problem is that if the values of these properties change and cause enabled to change, the MenuBar flickers (redraws itself) I guess. Those values mostly get recalculated if the user clicks on a row in a AdvancedDataGrid which in return changes the value of one of those properties.


      The flickering does not happen all the time and in various levels of severity. For the same actions, it sometimes does not happen, other times it happens but is ony very hard to notice and in quite a bunch of cases it really makes the whole bar flicker for about .5 seconds, which looks really bad.


      I tried changing the enabled property of the MenuBarItem programmatically instead and that seemed to work. But the MenuBar's menuBarItems array only has references to the top menu bar items. And from there I am not sure how to get the sub menu items.


      Does anybody have an idea what causes the repainting/flickering?


      Thanks for your help!


      Btw, I just noticed that it only seems to happen in FireFox. I tried it with Internet Explorer 8 and the flickering does not seem to occur there.