Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-29-2003, 12:36 PM   #1
Registered User
Join Date: May 2003
Posts: 13
Question Popup Window

Hi ..

Before I start I am very new to actionscripting and I'm picking itup as I go along.

here's my problem :

I am trying to get a button in my flash movie to launch a new window "popup" with the window centered.

I can create a popup without problem but I can get the window to become center.

Heres what I have in my html page that the swf is embeded in :

<script language="JavaScript">
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
if (document.all)
var xMax = screen.width, yMax = screen.height;
if (document.layers)
var xMax = window.outerWidth, yMax = window.outerHeight;
var xMax = 640, yMax=480;

var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;

newWindow=window.open(URLtoOpen, windowName, windowFeatures);


and heres my action script line on the button :

onClipEvent (load) {
_root.HomeButton.onMouseDown = function() {
getURL("javascriptpenNewWindow('http://www.kart-net.co.uk','GoogleGoogle','height=700,width=500,to p='+yOffset+',left='+xOffset+',toolbar=No,scrollba rs=No,resizable=No,menubar=No,status=No,directorie s=No,location=No');");

PLEASE HELP.. Im pulling my hair out!!


encrypt is offline   Reply With Quote
Old 05-29-2003, 01:07 PM   #2
Registered User
Join Date: May 2003
Posts: 13

Hi Again,

Just tried this insted :

getURL("javascript:window.open('http://www.kart-net.co.uk','Kart-Net','width=570,height=650,top='+((screen.height/2)-(NaN))+',left='+((screen.width/2)-(NaN))+',toolbar=no,scrollbars=no,resizable=no,men ubar=no,status=no,directories=no,location=no');voi d(0);");

I keep getting Debug errors in I.E when I try and test it...

Any Suggestions?
encrypt is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 09:24 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.