Flash Components      Flash Menu      Flash Gallery      Flash Slideshow      FLV Player      Flash Form      MP3 Player      PhotoFlow      Flash CMS      3D Wall      Flash Scroller

Flash / AS

Silverlight

WPF

ASP.net / PHP

Photoshop

Forums

Blog

About

 


FlashComponents
  Galleries
  Slideshows
  Menus
  Design & Effects
  Audio & Video
  User Interface
  Templates

 

 

Centered Pop-Up Window
       by kirupa  |  28 January 2006

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 1
In Flash, create a button. Give it the instance name btn_Up. Copy and paste the following code into a frame on your timeline:


Step 2
Publish 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 3
Find 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.

Note

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.

In the next page, I will explain how to customize the pop-up window.

Onwards to the next page!


kirupa.com's fast and reliable hosting provided by Media Temple. flash components
The Text Animation Component for Flash CS3
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.
Check out our high quality vector-based design packs! Flash Effect Components
flash menus, buttons and components Digicrafts Components
The best flash components ever! Entheos Flash Website Templates
Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com Purchase & Download Flash Components
flash components Free Website | Make a Website
Streamsolutions Content Delivery Networks Learn how to advertise on kirupa.com