Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with resizing window with javascript 1

Status
Not open for further replies.

disfasia

Programmer
Apr 20, 2001
378
CA
getURL("javascript:NewWindow=window.open('moulinx.html', 'newWin','scrollbars=no,status=no,width=800,height=550');NewWindow.focus();void(0);");


this is the code that i have in my flash, first frame (only frame), then (usually) the window will pop up and my neatly sized movie will show. however this is not working. please help.


thanks

disfasia
 
Try this:
Code:
getURL("javascript:window.open('moulinx.html','newWin','scrollbars=no,status=no,width=800,height=550');newWin.focus();void(0);");

Also the better way to do that is to place the javascript in the HTML that the movie is embedded in. So in the HTML page add a function:

Code:
<script language=javascript>
function newWindow(url){
    window.open(url,'newWin','scrollbars=no,status=no,width=800,height=550');
    newWin.focus();
    void(0);
}
</script>

Then your actionscript would be:
Code:
getURL("javascript:newWindow('moulinx.html')");

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
thanks so much pixl8r but i did this and nothing happened. is there supposed to be a long pause? i have done this before with buttons (which is what i ended up doing to the first page) and it seems to work faster. also, this might be change in the flash mx 2004 (i doubt it), but i used to use the code i put above in the first frame and this would always load the second page. in the code that you say to put in the embedded html, should i be putting the url with http? and with quotes?

thanks so much,

disfasia
 
Don't know what your problem was... Your posted link worked fine for me on IE5.5 this morning, before you've obviously tried pixl8r's suggestion...

You should remove the 'newWin' and only leave the 2 single quotes with nothing between them as ''...
Code:
<script language=javascript>
function newWindow(url){
    window.open(url,'','scrollbars=no,status=no,width=800,height=550');
    newWin.focus();
    void(0);
}

That said, as I said above, your previous code worked fine for me... What browser were you using when it failed?
</script>
Or set the window's name, this way...
Code:
<script language=javascript>
function newWindow(url){
    newWin=window.open(url,'newWin','scrollbars=no,status=no,width=800,height=550');
    newWin.focus();
    void(0);
}
</script>


Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
i will try again, thanks. it might be safari that doesn't allow this to work perhaps?
thanks

disfasia
 
hi again

i just tried it and did it with netscape 7 and it still doesn't work. what might be the problem?
thanks
disfasia
 
The script I posted above:

Code:
<script language=javascript>
function newWindow(url){
	window.open(url,'newWin','scrollbars=no,status=no,width=800,height=550');
    newWin.focus();
    void(0);
}
</script>

worked perfectly for me in IE 6 and Firefox. I would check to see if there isn't some security setting in Safari and/or Netscape that is preventing the javascript from executing. Barring that I don't really know what your problem might be.

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
i feel so stupid now. i had them on in safari, though i tested in netscape 7 and there are popups all over that software.. but the script that i initially used works fine.

thanks so much everyone!

peace,

disfasia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top