2 Replies Latest reply on May 26, 2010 1:44 AM by barjakxxx

    Strange Problem: MenuItem icon is displayed twice

    barjakxxx

      I have a simplest menu with icons. The problem is that when menu item is  clicked, the icon gets displayed twice(one on top of the other).

      i.e: The SubMenuItem A1 icon is displayed twice( along the top and left  side)

      Any ideas about how to prevent this??

       

       

       

       

       

       

       

       

        • 1. Re: Strange Problem: MenuItem icon is displayed twice
          TeotiGraphix Level 3

          Hi,

           

          Are you using a custom menu item renderer? If not and you are using the stock Menu, this seems like a bug. It really shouldn't since a whole bunch of other people would get it as well.

           

          Are you using icon fields or functions?

           

          Mike

          • 2. Re: Strange Problem: MenuItem icon is displayed twice
            barjakxxx Level 1

            TeotiGraphix wrote:

             

            Hi,

             

            Are you using a custom menu item renderer? If not and you are using the stock Menu, this seems like a bug. It really shouldn't since a whole bunch of other people would get it as well.

             

            Are you using icon fields or functions?

             

            Mike

            No, it's the simplest menu from adobe documentation!!

             

            No Renderers, embeded icons.

             

            The code is bellow. Any ideas?

             

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
                    <mx:Script>
                    <![CDATA[
                        import mx.controls.Menu;

                         [Bindable]
                         [Embed(source="./assets/forward.png")]
                              public var iconEdit:Class;  
                             
                              [Bindable]
                         [Embed(source="./assets/bank.png")]
                              public var iconEdit2:Class;  
                             
                        private function createAndShow():void {
                            var myMenu:Menu = Menu.createMenu(null, menuData, true);
                            myMenu.show(10, 10);
                        }

                        [Bindable]
                        public var menuData:Array = [
                            {label: "MenuItem A", children: [
                                {label: "SubMenuItem A-1", icon: "iconEdit"},
                                {label: "SubMenuItem A-2", icon: "iconEdit2"}
                                ]}
                            ];
                    ]]>
                </mx:Script>

                <!-- Button control to create and open the menu. -->
                <mx:Button x="300" y="10"
                    label="Open Menu"
                    click="createAndShow();"/>
            </mx:Application>

            </mx:Application>