NAVIGATION:

 

SUPPORTERS:

FlashComponents
  Flash Templates
  Flash Gallery
  Flash Slideshow
  Flash Menu
  Flash Design
  Flash Video
  User Interface

 

FOLLOW:

RSS it down! Twitter it up! Facebook it like a fiend!

 

 

In the previous page, you learned how to get a pop-up window working. In this page, you will learn how to modify your pop-up window so that you can use it however you wish.

First, let's take a look at your link:

javascript:Launch('<your URL>', width, height)

In my code, I had the <your URL> set to point to a file on kirupa.com. You can replace that with the page you are trying to open. The width and height fields represent the width and height of your pop-up window.

If you want your pop-up to point to Yahoo! and open in a 550x400 sized browser window, your link code would be:

javascript:Launch('http://www.yahoo.com', 550, 400)

With the link code, you can only adjust the URL and the dimensions of your pop-up window. There are more properties you can adjust with your pop-up window, and those can be modified in the JavaScript code you pasted into your HTML document.

The basic structure for opening a new window in JavaScript is:

this.open('<your URL>', "window ID", "properties")

The <your URL> argument simply tells your window what URL to display. The window ID argument is a string that allows you to refer to your new window. For example, if you want your Flash animation to load a new URL, under the target field for getURL, you would enter the window ID of your new window. This is similar to communicating with frames pages.

The properties string determines how your scrollbar looks. Whether your scrollbar will display the address bar, the status bar, horizontal/vertical scrollbars, etc. are specified here. In your code, these are the properties and their values that are used:

  • toolbar (yes/no)

  • menubar (yes/no)

  • location (yes/no)

  • scrollbar (yes/no)

  • resizable (yes/no)

  • width (number)

  • height (number)

  • top (number)

  • left (number)

In the above list, I also mention what type of argument each property takes. For example, toolbar takes in a yes or no argument while width takes in a numerical argument.

You can change those properties in the JavaScript itself. In my code, you will see that the window name is set to kirupa, and that is followed by the long list of properties that I listed above.

Note

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.

Conclusion
Well, 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 on the previous page:

Because of security settings in Flash, you might not be able to test the pop-up locally on your computer.

I hope the information helped. If you have any questions or comments, please don't hesitate to post them on the kirupa.com Forums. Just post your question and I, or our friendly forum helpers, will help answer it.

The following is a list of related tutorial and help resources that you may find useful:

How to use the Forums
New, Upcoming, and In-Progress Tutorials
How to Help out kirupa.com
Writing Tutorials
 

Cheers!

Kirupa Chinnathambi
kirupaBlog | twitter

 


SUPPORTERS:

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.

Flash Transition Effects

Flash Effect Tutorials

Digicrafts Components
The best flash components ever! Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com
Streamsolutions Content Delivery Networks Flipping Book - page flip flash component.
Learn how to advertise on kirupa.com

cdn
content delivery network (cdn)