     }
 
     protected var _dispatcher :IEventDispatcher;
+    protected var _fitting :Rectangle;
+    protected var _lefting :Boolean = false;
+    protected var _upping :Boolean = false;
 }
 }

        if (yShow == null) {
            yShow = DisplayObject(Application.application).mouseY;
        }
        super.show(xShow, yShow);
    }

    /**

    public function popUp (trigger :DisplayObject, popUpwards :Boolean = false,
                           popLeftwards :Boolean = false) :void
    {
        _upping = popUpwards;
        _lefting = popLeftwards;
        _fitting = null;
        var r :Rectangle = trigger.getBounds(trigger.stage);
        show(_lefting ? r.left : r.right, _upping ? r.top : r.bottom);
    }

    /**
     * Shows the menu at the current mouse coordinates, popping upwards or leftwards as necessary
     * to fit the menu into the supplied bounds.
     */
    public function popUpIn (bounds :Rectangle) :void
    {
        var mx :int = DisplayObject(Application.application).mouseX;
        var my :int = DisplayObject(Application.application).mouseY;

        // show it at zero zero so that it is layed out and measured
        show(0, 0);
        _fitting = bounds;

        // then determine if we need to point it leftwards or upwards
        if (mx + getExplicitOrMeasuredWidth() > bounds.right) {
            mx -= getExplicitOrMeasuredWidth();
        }
        if (my + getExplicitOrMeasuredHeight() > bounds.bottom) {
            my -= getExplicitOrMeasuredHeight();
        }

        // finally move it to the correct position
        x = mx;
        y = my;
    }

    /**
     * Shows the menu at the specified mouse coordinates.
     */
    public function popUpAt (mx :int, my :int, popUpwards :Boolean = false,
                             popLeftwards :Boolean = false) :void
    {
        _upping = popUpwards;
        _lefting = popLeftwards;
        _fitting = null;
        show(mx, my);
    }

    /**
