             menu = new Menu();
             menu.showRoot = false;
             
-            if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
-                menu.styleName = this;
-            
             var menuStyleName:Object = getStyle("menuStyleName");
             if (menuStyleName)
-            {
-                if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
-                {
-                    var styleDecl:CSSStyleDeclaration =
-                        StyleManager.getStyleDeclaration("." + menuStyleName);
-                    if (styleDecl)
-                        menu.styleDeclaration = styleDecl;
-                }
-                else
-                {
-                    menu.styleName = menuStyleName;
-                }
-            }
+                menu.styleName = menuStyleName;
             
             menu.sourceMenuBar = this;
             menu.owner = this;

            var m:Menu;
            if (menuStyleName)
            {
                if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
                {
                    var styleDecl:CSSStyleDeclaration =
                        StyleManager.getStyleDeclaration("." + menuStyleName);
         
                    if (styleDecl)
                    {
                        for (i = 0; i < menus.length; i++)
                        {
                            m = menus[i];
                            m.styleDeclaration = styleDecl;
                            m.regenerateStyleCache(true);
                        }
                    }
                 }
                 else
                 {
                    for (i = 0; i < menus.length; i++)
                    {
                        m = menus[i];
                        m.styleName = menuStyleName;
                    }
                 }
            }
        }
    }

import mx.controls.treeClasses.DefaultDataDescriptor;
import mx.core.ClassFactory;
import mx.core.EventPriority;
import mx.core.IFactory;
import mx.core.IFlexDisplayObject;
import mx.core.IUIComponent;
