PDA

View Full Version : center of the browser



flash_legend
October 5th, 2004, 09:33 AM
good day

basically a swf file contain a button
on the first frame i add this code




_global.openWinLeft = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
getURL("javascript: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+"))+'"+"');void(0);");
};




and on the button i add this code


on (release) {
address = "flashindex.swf";
target_winName = "";
width = 800;
height = 600;
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 1;
resizable = 0;
// sends data back to the function
openWinLeft(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}





ok..............
this problem is when it loads . it will open the browser but not resize automaticall like this site http://www.estudio.com


any help for that

Danno
October 5th, 2004, 09:05 PM
Try this:

This in Movie Frame Actions:

Movieclip.prototype.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);", "");
}


And put this on your button you want to launch the window:

on (release)
{
address = "http://www.yourWebSite.com";
target_winName = "YourWebSiteTitleName";
width = 400; //desired width
height = 300; //desired height
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 0;
resizable = 0;
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}

Let me know how that works out for ya

flash_legend
October 6th, 2004, 08:42 AM
thank you but this code will open a swf file or the browser it self???

Danno
October 6th, 2004, 06:53 PM
See the :


address = "http://www.yourWebSite.com";


Put in there whatever the path to the file or host or whatever you want to open, inside there

flash_legend
October 18th, 2004, 07:59 PM
the code is good but it not like the code in http://www.estudio.com


that site when the button is loaded the window resize on the screen what ever your screen is setup for example when your screen is 800*600 or 1024*768

it will open like the screen


hope this is understandable

thanks for your help

[m]
October 18th, 2004, 08:47 PM
window.open("bla","bla","fullscreen=true");

flash_legend
October 18th, 2004, 08:54 PM
thanks but where i can place it


thank you