Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
sonahawk webforumsuser@macromedia.com #1
New Window Sizing
Hi - -
I am using the getUrl action to open a new window (_blank) when clicking on a graphic, but I want to be able to control the size and screen position of that new window. Does anyone know if there is an area in Flash's Actionscript where I can add custom code or modify code to do this?
Thanks for any help!
John
sonahawk webforumsuser@macromedia.com Guest
-
Sizing of the controls in relation to the browser window
Hi, When the user opens my program in the browser and the browser window is maximized, the sizing of all the controls such as Accordions,... -
Sizing the dataGrid
I have a dataGrid on a form, In design mode it behaves as I would expect when resizing the form. However when I populate it when running, it no... -
! HELP : sizing my pop-up window : HELP !
Hey, I am currently making my fourth website, however this is my first all Flash site. I have created my index page as an entry page and the main... -
window sizing & close this window code
Sharon wrote on 16 jul 2003 in microsoft.public.inetserver.asp.general: No ASP to be seen, Sharon, please see a clientside NG, --... -
window sizing
thanks for the tutorial... i'm still having problems. this is starting to drive me insane. ok, the tutorial tells you how to make a new window,... -
Nixy webforumsuser@macromedia.com #2
Re: New Window Sizing
U can use javascript in the html code page.
Place it in your head tag
// Html page code
//-------------------------------------------------------------------------
<script language="JavaScript">
<!--
var iWin1Width = 1010;
var iWin1Height = 559;
function fOpenWin()
{
newWin1 = window.open("yourPageName.html","_blank",'toolbar= 0,menubar=0,location=0,directories=0,status=0,scro llbars=0,resizable=0,width=' + iWin1Width + ',height=' + iWin1Height + ',left=0,top=0');
}
//-->
</script>
Than in your flash file, on your button use this code:
// Flash code
//-------------------------------------------------------------------------
on(release){
getURL("javascript:fOpenWin();")
}
hope that can help u
Nixy webforumsuser@macromedia.com Guest
-
sonahawk webforumsuser@macromedia.com #3
Re: New Window Sizing
Thanks!! I'll try it and let you know.
John
sonahawk webforumsuser@macromedia.com Guest
-
sonahawk webforumsuser@macromedia.com #4
Re: New Window Sizing
Thanks, the script worked great!
I want to position the window in the center of the screen for any user. I was able to move the window postion around typing in different numerical values in the "left=0,top=0 part of the code below, but cannot get it to the center of the screen. Is there a way to do this and make it appear in the center for each unique viewer? Thanks again for your help!
newWin1 = window.open("credits.html","_blank",'toolbar=0,men ubar=0,location=0,directories=0,status=0,scrollbar s=0,resizable=0,width=' + iWin1Width + ',height=' + iWin1Height + ',left=0,top=0');
sonahawk webforumsuser@macromedia.com Guest
-
Nixy webforumsuser@macromedia.com #5
Re: New Window Sizing
U just have to modify the code a little bit. Like that
// Html Code
//---------------------------------------------
<script language="JavaScript">
<!--
var iWin1Width = 1010;
var iWin1Height = 559;
var iWin1PosX = (screen.width / 2) - (iWin1Width / 2);
var iWin1PosY = (screen.height / 2) - (iWin1Height / 2);
function fOpenWin(btn_lng)
{
if(screen.width <= iWin1Width || screen.height <= iWin1Height) {
newWin1 = window.open("yourPageName.html","_blank",'toolbar= 0,menubar=0,location=0,directories=0,status=0,scro llbars=0,resizable=0,width=' + iWin1Width + ',height=' + iWin1Height + ',left=0,top=0');
} else {
newWin1 = window.open("yourPageName.html","_blank",'toolbar= 0,menubar=0,location=0,directories=0,status=0,scro llbars=0,resizable=0,width=' + iWin1Width + ',height=' + iWin1Height + ',left=' + iWin1PosX + ',top=' + iWin1PosY);
}
}
//-->
</script>
I use an if statement to verify if the screen is smaller or bigger than the page you want to open. If it's smaller, the new window will be position at 0, 0 elsethe new window will be centered in the screen.
Hope that can help u
Nixy webforumsuser@macromedia.com Guest
-
sonahawk webforumsuser@macromedia.com #6
Re: New Window Sizing
Thanks so much...that works great!
Best,
John
sonahawk webforumsuser@macromedia.com Guest
-
sonahawk webforumsuser@macromedia.com #7
Re: New Window Sizing
Hi - -
I want the user to be able to scroll down through more info. than the sized window will display. If I want the popup window to have a vertical scroll capability, do I use a "scrollbars" command in the code? If so, where in the code would that be put? I just started teaching myself Javascript and am not sure how to incorporate that function into the code to make it work.
Thanks,
John
sonahawk webforumsuser@macromedia.com Guest
-
Nixy webforumsuser@macromedia.com #8
Re: New Window Sizing
0 = false
1 = true
In this part of code, you can set many setting of the new window. In this case all was set to false (0). You can set the scrollbar to true changing the 0 for 1 in the following sentence.
'toolbar=0,menubar=0,location=0,directories=0,stat us=0,scrollbars=0,resizable=0,width=' + iWin1Width + ',height=' + iWin1Height + ',left=0,top=0'
example -> scrollbars=1
hope that can help u
Nixy webforumsuser@macromedia.com Guest



Reply With Quote

