View Full Version : New browser window?
lvalesko
01-19-2001, 06:13 AM
I'd like to be able to have a button in my Flash movie open a new browser window containing a plain 'ol html page. I don't want the new browser window to have anything but scrollbars and I want to be able to control the size of the new browser window. I tried tutorial #5 "Spawning external browser windows" but all I got was a new browser window with all of the javascript in the address bar. When I copied and pasted the code like it said there were lots of weird spaces PLUS I wasn't exactly sure WHERE to paste the code.
Can someone please help!?
Thanks,
Lori
GoldRain
01-19-2001, 08:46 AM
Same problem here. Anyone help ?
Strok
01-19-2001, 02:14 PM
You can use this way
In HTML in "HEAD tag" add following code:
<script language="JavaScript">
<!-- hide from JavaScript-challenged browsers
function openWindow(url, w, h) {
var windowprops = "width=" + w + ",height=" + h;
popup = window.open(url,'remote',windowprops);
}
// done hiding -->
</script>
Now for the action to the Flashed Button
Get url JavaScript:openWindow("your.html","100","250")
lvalesko
01-19-2001, 05:10 PM
Strok,
Is the spacing in the javascript critical? Does the code in my html have to look EXACTLY like the code you shared with us - weird spaces and all?
Also, where do you put the window attributes such as size, scrollbars, etc??
Thanks,
LV
lvalesko
01-19-2001, 05:12 PM
Forgot to mention I'm using Flash 4...
Jesse
01-19-2001, 10:13 PM
Sorry everyone, I've founda flaw in the tutorial. i obviously pasted the code incorrectly.
See it working (http://www.actionscripts.org/help/popup/pop.html)
Get the source (http://www.actionscripts.org/help/popup/pop.zip)
The code generator works fine but the HTML you should put between your head tags is this:
<script language="JavaScript">
<!--
function spawnWindow(URL,Name,features) {
window.open(URL,Name,features);
}
//-->
</script>
I'll fix up the tutorial today. Thanks for pointing it out!
Cheers
Jesse
GoldRain
01-20-2001, 02:23 AM
Thanks for the help/fix-up Jesse. Superb.
FlashBulb
03-14-2007, 07:53 PM
When I open a new window with javascript, and set "location='no'", it merely makes the Address Bar unselectable and unchangeable.
I would like to be able to hide the Address Bar completely - is this possible?
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.