             request.useWeakReference = useWeakReference;
 		    if (!dispatchEvent(request))
 			    return;
+        }
+
+        if (type == SandboxMouseEvent.MOUSE_UP_SOMEWHERE)
+        {
+            // If someone wants this event, also listen for mouseLeave.
+            // Use weak listener because we don't always know when we
+            // no longer need this listener
+            try
+            {
+			    if (stage)
+			    {
+				    stage.addEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler, false, 0, true);
+                }
+                else
+                {
+					super.addEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler, false, 0, true);
+                }
+			}
+			catch (error:SecurityError)
+			{
+				super.addEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler, false, 0, true);
+			}
         }
 		
 		// These two events will dispatched to applications in sandboxes.

import mx.events.DynamicEvent;
import mx.events.FlexEvent;
import mx.events.ResizeEvent;
import mx.preloaders.Preloader;
import mx.utils.LoaderUtil;


											  priority:int = 0,
											  useWeakReference:Boolean = false):void
	{
		if (type == MouseEvent.MOUSE_MOVE || type == MouseEvent.MOUSE_UP || type == MouseEvent.MOUSE_DOWN 
				|| type == Event.ACTIVATE || type == Event.DEACTIVATE)
		{
			// also listen to stage if allowed
			try
			{
				if (stage)
				{
                    // Use weak listener because we don't always know when we
                    // no longer need this listener
					stage.addEventListener(type, stageEventHandler, false, 0, true);
				}
			}
			catch (error:SecurityError)
			{
			}
		}

        if (hasEventListener("addEventListener"))
        {
            var request:DynamicEvent = new DynamicEvent("addEventListener", false, true);
