      */
     public function setMediaObject (disp :DisplayObject) :void
     {
-        _url = null;
         if (_media != null) {
             shutdown(false);
         }
+        _url = null;
 
         willShowNewMedia();
         addChildAt(disp, 0);

                loader.unload();

                removeChild(loader);
                log.info("Unloaded media [url=" + url + "].");

            } else if (_media is VideoDisplayer) {
                var vid :VideoDisplayer = (_media as VideoDisplayer);

        if (Util.equals(_url, url)) {
            return; // no change
        }

        // shutdown any previous media
        if (_media != null) {
            shutdown(false);
        }
        _url = url;

        // set up the new media
        willShowNewMedia();
