0 Replies Latest reply on May 14, 2008 4:07 PM by sandisi

    Opening Centered Pop-up window with Dynamic URL

    sandisi
      I got some code for a centered pop-up window in Flash from a Kirupa tutorial. It works well, except that you are supposed to put an actual URL for the 'address' variable. I'm using a dynamic URL (+url[p]+) for my URL. When I put address = "'+url[p]'"; for the address, it doesn't work.

      Here's the code for the button:

      on (release) {

      //customize the window that gets opened
      // 0 equals NO.
      // 1 equals YES.
      address = "'+url[p]+'";
      target_winName = "FlashDevelopment";
      width = 700;
      height = 400;
      toolbar = 0;
      location = 0;
      directories = 0;
      status = 1;
      menubar = 0;
      scrollbars = 1;
      resizable = 1;
      //sends data back to the function
      openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);

      }

      And here's the function:

      // New Window Function
      _root.openWinCentre = function (url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
      getURL ("javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open('" + url + "','" + winName + "','" + "width=" + w + ",height=" + h + ",toolbar=" + toolbar + ",location=" + location + ",directories=" + directories + ",status=" + status + ",menubar=" + menubar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",top='+((screen.height/2)-(" + h/2 + "))+',left='+((screen.width/2)-(" + w/2 + "))+'" + "')}else{myWin.focus();};void(0);");
      }

      Any idea why my dynamic url is not being recognized?