View Full Version : Specific size popup windows in flash
t-willis
11-13-04, 12:34 PM
Hi,
Does anyone know how I create a popup window in flash that will open a new browser window to a specific screen resolution?
Thanks in advance
corey snyder
11-29-04, 11:36 PM
This is fairly easy, just a few little things need to be done.
First slect the button and in the actions panel type
on (release) {
getURL("javascript:Launch('http://www.yoursite.com/popup.htm')");
}
"yoursite is your domin and popup is the pop up page name"
The flash part is done. Bam simple right?
Now publish the flash file. flash will make an HTML version of your flash movie.
Open the HTML file that Flash created in an HTML editor such as Notepad or FrontPage and DreamWeaver in HTML view.
Once the file has been opened in your HTML editor, place your mouse anywhere between the <Body> and </Body> tags and copy and paste the following code.
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Launch(page) {
OpenWin = this.open(page, "KirupaStyle", "toolbar=no,menubar=no,location=no,scrollbars=no,re sizable=yes,width=550,height=250");
}
// End -->
</SCRIPT>
Once the code has been pasted, save the file and preview it in your browser. The button you created in Flash should be visible. Click the button and a new window should appear with the address you specified.
Adjusting Window Width and Height:
The primary attribute of the new window you will want to modify is the width and the height. Notice in the code where it says width=550, height=250. By looking at the code, you can assume that the width of the new window will be 550 pixels, and the height of the new window will be 250 pixels wide.
To set your own width and height for the browser window, change the values after width to adjust the width and the values after height to adjust the height. That is all there is to adjusting the width and height of a new window.
Customizing the Window:
Let's talk about customizing the window that gets opened beyond the width and height. Go back to your HTML editor and open the HTML file you just modified. Briefly look at the JavaScript code you copied. You should notice many familiar terms such as location, menubar, scrollbars, and more. The terms mentioned in the code are the attributes of your browser window...in other words, the things that make your browser window look the way it looks.
After each window attribute, you will see a 'yes' or a 'no'. No means that attribute has been disabled and won't be expressed in the browser. For example, in the code you copied, scrollbars are disabled. To enable/disable any attribute, change the 'no' to a 'yes' or vice-versa.
Simple? Good luck.
Any trouble post or google
Corey
aka007ii
12-19-04, 06:50 PM
Your code is blocked by popup blockers. Anyone know a workaround? As far as I'm concerned they shouldn't have blocked popup windows that are activated from clicking. Microsoft didn't think about this problem in Flash because it's not their problem.
if you can't block a popup window with a popup blocker.....you need a new popup blocker. any workaround is an exploit and some spammer/advertiser somewhere will take advantage of it...until it's blocked by a popup blocker. It's a bit circular.
I agree that popup blockers probably shouldn't block popups related to a mouse click, but that's the popup blocker maker's fault. And then there's the question of how many popups to allow on a click. :)
fiona365099
1-23-05, 06:41 PM
I happened to come across this post when I was doing a Google search looking for a script to create a pop up window from a Flash page. I just wanted to say thank you! It works exactly the way I wanted to! I haven't had any problems with pop up blockers blocking the window, which is how I would expect it to as the pop up is activated by clicking.
Thank you!
corey snyder
1-31-05, 11:49 PM
the code is javascript.. flash is relaying that to the browser.. microsoft has stoped the javascript in the newer versions of ie.. flash is not the answer here... but try looking into other pop up blockers.. have not seen to many problems with the for mentioned code...
sorry i couldnt help
goldmind
2-23-05, 06:59 PM
For some reason that code didn't work for me. It didn't maintain page size and I could still resize the window. But I did find this code on:
THIS SITE (http://javascript.internet.com/page-details/frameless-popup.html)
The whole thing works perfect for Netscape, Firefox and Mozilla but not in IE :confused: . I can hear the swf load (because it has sounds) but see nothing. Whats up with that? Why does everything work great in all the other browsers but not IE. If IE is blocking this pop-up then why do I hear it load and why is there a tab on my toolbar for the window? Can someone enlighten me on this? I have attached the script:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script ="javascript">
<!-- Begin
var windowW=940 // wide
var windowH=750 // high
var windowX = 260 // from left
var windowY = 100 // from top
var urlPop = "http://localhost/Blacklinesite/PR0004OR.html"
var title = "This Is A Frameless Popup Window"
// set this to true if the popup should close
// upon leaving the launching page; else, false
var autoclose = true
// do not edit below this line
s = "width="+windowW+",height="+windowH;
var beIE = document.all?true:false
function openFrameless() {
if (beIE) {
NFW = window.open("","popFrameless","fullscreen,"+s);
NFW.blur();
window.focus();
NFW.resizeTo(windowW,windowH);
NFW.moveTo(windowX,windowY);
var frameString=""+
"<html>"+
"<head>"+
"<title>"+title+"</title>"+
"</head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
"<frame name='top' src='"+urlPop+"' scrolling=auto>"+
"<frame name='bottom' src='about:blank' scrolling='no'>"+
"</frameset>"+
"</html>";
NFW.document.open();
NFW.document.write(frameString);
NFW.document.close();
}
else {
NFW = window.open(urlPop,"popFrameless","scrollbars,"+s);
NFW.blur();
window.focus();
NFW.resizeTo(windowW,windowH);
NFW.moveTo(windowX,windowY);
}
NFW.focus();
if (autoclose) {
window.onunload = function(){NFW.close();}
}
}
// End -->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<a href="javascript:openFrameless()">launch site
</a>
</body>
</html>
Thanks for your help,
Goldmind
goldmind
2-23-05, 07:11 PM
Honestly, am I going about this the correct way? All I want to do is have a person click a link and launch a swf file. Here is an example of a site that once you get to the index page you click the link or simply wait and it opens the main flash site in a smaller non-sizable window.
Example:
Roomservice-la (http://roomservice-la.com/index3.html)
That is exactly what I want to do, but how do you do it?
Thanks,
Goldmind
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.