         {
             menu = IMenuItemRenderer(row).menu;
         }
-
+        
         var _do:DisplayObject = DisplayObject(row);
-        var pt:Point = new Point(0,0);
-        pt = _do.localToGlobal(pt);
+        var sandBoxRootPoint:Point = new Point(0,0);
+        sandBoxRootPoint = _do.localToGlobal(sandBoxRootPoint);
         // when loadMovied, you may not be in global coordinates
         if (_do.root)   //verify this is sufficient
-            pt = _do.root.globalToLocal(pt);
-        menu.show(pt.x + row.width, pt.y);
+            sandBoxRootPoint = _do.root.globalToLocal(sandBoxRootPoint);
+        
+        // showX, showY are in sandbox root coordinates
+        var showY:Number = sandBoxRootPoint.y;
+        var showX:Number;
+        if (!isDirectionLeft)
+            showX = sandBoxRootPoint.x + row.width;
+        else
+            showX = sandBoxRootPoint.x - menu.getExplicitOrMeasuredWidth();
+        
+        // convert to global coordinates to compare with getVisibleApplicationRect().
+        // the screen is the visible coordinates of our sandbox (written in global coordinates)
+        var screen:Rectangle = systemManager.getVisibleApplicationRect();
+        var sbRoot:DisplayObject = systemManager.getSandboxRoot();
+        
+        var screenPoint:Point = sbRoot.localToGlobal(new Point(showX, showY));
+        
+        // do x
+        var shift:Number = screenPoint.x + menu.getExplicitOrMeasuredWidth() - screen.right;
+        if (shift > 0 || screenPoint.x < screen.x)
+        {
+            // if we want to ensure our parent's visible, let's 
+            // modify the shift so that we're not just on-screen
+            // but we're also shifted away from our parent.
+            var shiftForParent:Number = getExplicitOrMeasuredWidth() + menu.getExplicitOrMeasuredWidth();
+            
+            // if was going left, shift to right.  otherwise, shift to left
+            if (isDirectionLeft)
+                shiftForParent *= -1;
+            
+            showX = Math.max(showX - shiftForParent, 0);
+            
+            // now make sure we're still on-screen again
+            screenPoint = new Point(showX, showY);
+            screenPoint = sbRoot.localToGlobal(screenPoint);
+            
+            // only shift if greater our position + width > width of screen
+            shift = Math.max(0, screenPoint.x + width - screen.right);
+            
+            showX = Math.max(showX - shift, 0);
+        }
+        
+        menu.isDirectionLeft = this.x > showX;
+        
+        // now do y
+        shift = screenPoint.y + height - screen.bottom;
+        if (shift > 0 || screenPoint.y < screen.y)
+            showY = Math.max(showY - shift, 0);
+        
+        menu.show(showX, showY);
+        
         subMenu = menu;
         clearInterval(openSubMenuTimer);
         openSubMenuTimer = 0;

    mx_internal function openSubMenu(row:IListItemRenderer):void
    {
        supposedToLoseFocus = true;

        var r:Menu = getRootMenu();
        var menu:Menu;

        // check to see if the menu exists, if not create it
        if (!IMenuItemRenderer(row).menu)
        {

        if (visible)
            return;

        if (parentDisplayObject && (!parent || !parent.contains(parentDisplayObject)))
        {
            PopUpManager.addPopUp(this, parentDisplayObject, false);
            addEventListener(MenuEvent.MENU_HIDE, menuHideHandler, false, EventPriority.DEFAULT_HANDLER);
