Pop-up window script help

What would you add to this script to be able to keep the scrollbars? This opens a pop up but not resizable and without scrollbars.

on (release) {
uUrl = “http://the url of the html you want to open”;
wdth = “the width you want”;
hdth = “the height you want”;
getURL (“javascript:window.open(’“add uUrl add” ',‘nName’,'width=” add
wdth add “,height=” add
hdth add “,top=’+((screen.availHeight/2)-(” add hdth/2 add
“))+’,left=’+((screen.availWidth/2)-(” add
wdth/2 add “))); void(0);”);
}

This is untested but to open a new window using javascript you would add scrollbars=yes to the code

right,
But where? I’ve tried putting it in amost every spot in that code.

Try something like this:
getURL(javascript:openNewWindow(‘http://www.macromedia.com’,‘myWindow’, ‘height=400,width=400,toolbar=no,scrollbars=yes’);

And of course you can replace the URL stuff with your variables, but that’s the basic syntax of it. Broken down, it goes like this…

getURL(javascript:openNewWindow(URL,WindowName,WindowAtrtributes);

Hope this helps.

Hehe…you also need some javascript on the page.

<script language=“JavaScript”>
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
</script>

Sorry.

//<script language=“JavaScript”>
//function openNewWindow(URLtoOpen, windowName, //windowFeatures) {
//newWindow=window.open(URLtoOpen, windowName, //windowFeatures); }
//</script>
It’s not letting me post this…trying to comment it.

function openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=window.open(URLtoOpen, windowName, windowFeatures); }

all this goes inside the script tags. Sorry for the multiple posts.

Looking back, I could have answered your question a lot quicker. You just need the scrollbar attribute in commas in the the third section. AHHH!!! CONFUSION!!!

Mr. Twinkles,

Please show me where you are talking about putting the scrollbar=yes code.
Like I said, I’ve tried putting it in every spot in that code with no results.

Snake

try this. In the flash movie, put this code:

on(release){
getURL(“javascript:myPopup();”);
}

in the html page, put this in the head section between script tags.

function myPopup(){
myURL = “http://www.google.com
window.open(‘http://www.google.com’, ‘mywindow’,‘toolbar=yes,scrollbars=yes,location=yes,statusbar=yes,menubar=yes,resizable=yes,width=400,height=300,left = 300,top = 200’);
}

and you can edit all the attributes. I’m pretty sure you can put everything in the flash movie, but this could be easier. You can set it up to where everything is a variable if you’d like, and then just pass the variable in flash like:
getURL(“javascript:myPopup(URL,toolbar,scrollbar,etc)”);
just make sure you change the myPopup function in the html page to accept the variable within the window.open(); part of it.

Hope this works for you.

thanks,

but I was trying to avoid any html script.

thanks for your time anyway.

Snake

Ok, here’s the same deal without any html. When you test this in flash, use Ctrl + F12 to test in the browser. That way it doesn’t pop up the extra window like Ctrl + Enter will. Anyway, here’s the code:

on (release) {
getURL(“javascript:window.open(‘http://www.google.com’,‘MyWindow’,‘toolbars=no, scrollbars=yes, resizable=no, width=200, height=500, menubar=yes, left=300, top=500’)”);
}

Sorry for not getting this how you wanted sooner. Have fun.

Ah, ok
So the left= and top= specify where the window opens on the x-y axis?

thanks man.