PDA

View Full Version : JS javascript from pop-up tutorial doesn't work in Explorer



kathari
October 20th, 2009, 06:22 AM
Hi,
I have made a "pop-up" window from Flash with the help of this tutorial: http://www.kirupa.com/developer/flash8/video/popUpWindows.htm
However it doesn't seem to work on Explorer. I get an "error in page" message.
It works fine in Opera, Safari, Firefox for Mac.

I made the code as it says in the tutorial but also added this to the page in the header:

<script language="JavaScript" type="text/JavaScript">
<!--
window.moveTo(0,0)
window.resizeTo(screen.availWidth,screen.availHeig ht)
//-->
</script>
Anyone knows what's wrong?:*(

kathari
October 20th, 2009, 07:09 AM
Sorry,
should probably include the code from the tutorial:

<script language="javascript">
function launch(thepage) {
openWin = this.open(thepage, "showreel", "toolbar=no, scrollbars=no, location=no, width=620, height=362, top=300, left=350");
}
</script>
And in Flash:

showreelBUTTON.onRelease = function() {
getURL ("javascript:launch('showreel.php')");
}

actionAction
November 5th, 2009, 11:54 PM
function winOpen(url:String, winName:String, wide:Number, high:Number, chrome:Boolean, centered:Boolean)
{
//Chrome on window un-centered
if (chrome == true && centered == false)­
{
getURL("javascript:"+winName+"=window.open('"+url+"', '"+winName+"', 'width="+wide+",height="+high+",left=0,top=0,toolbar=1,location=1,scrollbars=1,st atus=1,resizable=1,fullscreen=no'); "+winName+".focus(); void(0);");
}
//Chromeless un-centered
else if (chrome == false && centered == false)­
{
getURL("javascript:"+winName+"=window.open('"+url+"', '"+winName+"', 'width="+wide+",height="+high+"'); "+winName+".focus(); void(0);");
}
//Chrome on, centered
else if (chrome == true && centered == true)
{
getURL("javascript:"+winName+"=window.open('"+url+"', '"+winName+"', 'width="+wide+",height="+high+",left=0,top=0,toolbar=1,location=1,scrollbars=1,st atus=1,resizable=1,fullscreen=no'); "+winName+".focus(); screen_height = window.screen.availHeight;screen_width = window.screen.availWidth; left_point = parseInt(screen_width/2)-("+wide+"/2); top_point = parseInt(screen_height/2)-("+high+"/2); setTimeout('"+winName+".moveTo(left_point,top_point)',10); void(0);");
}
//Chromeless, centered (most popular!)
else if (chrome == false && centered == true)
{
getURL("javascript:"+winName+"=window.open('"+url+"', '"+winName+"', 'width="+wide+",height="+high+",left=0,top=0,toolbar=no,location=no,scrollbars=no ,status=no,resizable=no,fullscreen=no'); "+winName+".focus(); screen_height = window.screen.availHeight;screen_width = window.screen.availWidth; left_point = parseInt(screen_width/2)-("+wide+"/2); top_point = parseInt(screen_height/2)-("+high+"/2); setTimeout('"+winName+".moveTo(left_point,top_point)',10); void(0);");
}
}

//Sample of application, requires a button with instance name of button_mc on stage
button_mc.onRelease = function()
{
winOpen("http://www.bitconsultants.net/", "MyWindow", 350, 350, true, true);
­}