Yeah I had this problem since Beta 1. I thought people would have figured to just move something on their screen and put it back in place
 
in your case... increase the height of the view stack by +1 and then decrease it by ( -1 ) and should force it to refresh the whole view stack
 
keep in mind though... it will only get rid of the part that the menu is on
 
WARNING: this may not work for everybody or may not work well sometimes either

 
On 3/29/06, sourcecoderia <[EMAIL PROTECTED]> wrote:

So there seems to be a bug in the view stack not redrawing it's children, or a bug in the popupbutton.

 

The dropdown menu is not being cleared. The only way to avoid it is to add the menu as a child to the popupbuttons parent container and don't include it in the layout.

 

See below code. Run it an click the popupbutton to see the effect. Then uncomment the addchild and include in layout code and run again to see the temp solution.

 

This is not view stack container specific i.e. same problem on Vbox, Hbox, Controlbar, ApplicationControlbar, Box, Canvas etc..

 

On the other hand it may very well be the only way to do it. If this is true update the documentation to specify so.

 

Code test:

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute">

<mx:Script>
 <![CDATA[
   import mx.controls.Menu;
   import mx.events.MenuEvent;
   private var actionMenu:Menu;

            private function initMenu():void {
                actionMenu = new Menu();
               
                //actionMenu.includeInLayout = false;
                //tools.addChild(actionMenu);
               
              
                var actionMenuDS:Object = [{label: "Complete selected"}, {label: "Delete selected"}, {label: "Export list"}];       
                actionMenu.width = actionList.width;
               
                actionMenu.dataProvider = actionMenuDS;
                actionMenu.addEventListener("change", handleChange);
                actionList.popUp = actionMenu;
               
            }

            //Execute the action reqested and update the control display
            private function handleChange(event:MenuEvent):void {
                actionList.label = event.menuItem.label ;
                actionList.close();
               
            }
     
  
 ]]>
</mx:Script>

<mx:ViewStack height="100%" id="Cont" width="100%">
 <mx:Canvas id="tools" width="100%" height="34" borderStyle="solid"  backgroundColor="#c0c0c0">
  <mx:PopUpButton textAlign="left" id="actionList" cornerRadius="0"  label="Actions" width="155" creationComplete="initMenu();"/>
 </mx:Canvas>
</mx:ViewStack> 

</mx:Application>

 

Any thoughts ??

 

Jason

 

 



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to