     {
         menu.parentDisplayObject = parent ?
                                    parent :
-                                   DisplayObject(ApplicationGlobals.application);
+                                   DisplayObject(FlexGlobals.topLevelApplication);
 
         if (!mdp)
             mdp = new XML();

import mx.controls.menuClasses.MenuItemRenderer;
import mx.controls.menuClasses.MenuListData;
import mx.controls.treeClasses.DefaultDataDescriptor;
import mx.core.ApplicationGlobals;
import mx.core.ClassFactory;
import mx.core.EdgeMetrics;
import mx.core.EventPriority;
import mx.core.IFlexDisplayObject;
import mx.core.ScrollPolicy;
import mx.core.UIComponent;

    {
        var menu:Menu = new Menu();
        menu.tabEnabled = false;
        menu.owner = DisplayObjectContainer(FlexGlobals.topLevelApplication);
        menu.showRoot = showRoot;
        popUpMenu(menu, parent, mdp);
        return menu;
