da5id
03-10-2006, 09:10 AM
A friend sent me this, can anyone offer him some assistance.
I have successfully used a custom script (call jscript) in the past to center pop up a browser window with all controlled parameters .. no tool bar, scroller etc etc .. I tried the same script after upgrading to XP SP2 / Flash 8 with no success. The actionscript version that has worked in the past but not now is below. Part A gets pasted into the keyframe whereas Part B of the script gets attached to the button symbol instance. Got me!! Worked before but not now. Although I don't consider myself to be a programmer and not well versed at programming in actionscript I am totally open to giving it a try if you have any ideas. See below for the actionscript/jscript that has worked but doesn't seem to want to now.
PART A > to keyframe
Movieclip.prototype.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
getURL("disabled-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);");
};
PART B > to the button symbol
on (release) {
// customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = "bio/bio.html";
target_winName = "bio";
width = 354;
height = 424;
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 0;
resizable = 0;
// sends data back to the function
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}
thanx da5id.
I have successfully used a custom script (call jscript) in the past to center pop up a browser window with all controlled parameters .. no tool bar, scroller etc etc .. I tried the same script after upgrading to XP SP2 / Flash 8 with no success. The actionscript version that has worked in the past but not now is below. Part A gets pasted into the keyframe whereas Part B of the script gets attached to the button symbol instance. Got me!! Worked before but not now. Although I don't consider myself to be a programmer and not well versed at programming in actionscript I am totally open to giving it a try if you have any ideas. See below for the actionscript/jscript that has worked but doesn't seem to want to now.
PART A > to keyframe
Movieclip.prototype.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
getURL("disabled-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);");
};
PART B > to the button symbol
on (release) {
// customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = "bio/bio.html";
target_winName = "bio";
width = 354;
height = 424;
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 0;
resizable = 0;
// sends data back to the function
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}
thanx da5id.