Despite not being user-friendly, pop-up windows are very popular ways of displaying content. With pop-up windows, you have the added advantage of being able to hide the unnecessary browser GUI features such as the toolbars, address bar, status bar, etc. that might make viewing your animation less pleasant.
In this tutorial, I will explain how to create a new pop-up window that is centered perfectly on your screen. Click on the GO button in the following animation for an example of what you can create:
[ click the GO button to launch a pop-up ]
When you pressed the GO button in the example above, you should have seen a new window appear in the center of your screen. Let's get this working in three easy steps.
Step 1In Flash, create a button. Give it the instance name btn_Up. Copy and paste the following code into a frame on your timeline:
btn_Up.onRelease = function() {
getURL("javascript:Launch('http://www.kirupa.com/sotw/archive.htm', 400, 300)");
};
Step 2Publish your Flash movie by going to File | Publish. When you Publish, the directory containing your movie will now have your FLA, the SWF, and the HTML file corresponding to the SWF:

[ files produced after you Publish your FLA ]
Step 3Find the HTML file produced by Flash after you published your movie, open that file in a HTML editor, and copy and paste the following JavaScript code above the <body> tag of your HTML code:
If you open your HTML file in a browser, you should see your Flash animation. Click on the button and the pop-up window will appear.
If your JavaScript code is on the HTML page generated by Flash, and if you were to re-publish your animation in Flash, you will have to manually re-paste the JavaScript code into your HTML document.When you publish, Flash overwrites any old SWF's and HTML files with the new version.
For width, height, top, and left properties, you should leave them unaltered. They use the arguments from your link code, and making any modifications could cause your centered pop-up window to not work as advertised.
ConclusionWell, you are finished with this tutorial. This code was based on the code I used in the pop-up window tutorial written many years ago. I have provided the source file, swf, and HTML files used for the example animation:
Because of security settings in Flash, you might not be able to test the pop-up locally on your computer.
Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence, ads, and algorithm-driven doodads. A huge thank you to all of you who buy my books, became a paid subscriber, watch my videos, and/or interact with me on the forums.
Your support keeps this site going! 😇

Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence, ads, and algorithm-driven doodads. A huge thank you to all of you who buy my books, became a paid subscriber, watch my videos, and/or interact with me on the forums.
Your support keeps this site going! 😇

:: Copyright KIRUPA 2026 //--