View Full Version : OpenPop Help

02-03-2009, 04:45 PM
This is a mix of flash using javascript but I will stick with the java part for here.

I have this code in my HTML

function OpenPopup(){

var xMax = 800, yMax=600; // default

var w=520, h=310; //popup size

if (document.all || document.layers) {

xMax = screen.availWidth;

yMax = screen.availHeight;


xMid = xMax - w;

yMid = yMax - h;

var xOffset = xMid/2 , yOffset = yMid/2;

window.open('pagelink.html', 'newWin', 'width='+w+',height='+h+', top='+yOffset+', left='+xOffset+'scrollbars=no,resizable=no, statusbar=no');


How would I go about assigning a universal value for the URL? I am using an XML gallery in my flash site and the values for the URL will come from flash for each image so the 'pagelink.html' needs to be a value that is dynamic not static.

I hope that makes sense.

I use this code for other sites I work with.

<SCRIPT type=text/javascript>
function launchWin(furl,fwidth,fheight){
var x=((screen.width-fwidth)/2);
var y=((screen.height-fheight)/2);

// -->

Which uses the link from the button clicked instead of assigning a static one. But of course the width and height are dynamic too which I don't want.

Any help with this would be great.

-- Nate