Using Flash And Java To Create Pop-Ups

With Flash it is quite common to have a customized pop up window to hold your flash movie. This is almost always done using HTML and JavaScript. Well, what about having buttons in your flash movies that will open customized pop up windows?

In this tutorial I am going to show you how to incorporate Flash and Java to do the same effect from a Flash movie.

First we need to create our button. For this tutorial to make things as simple as possible we are going to create a very simple button. With your rectangle tool draw a rectangle.

Now highlight the button and hit F8, which will bring up convert to symbol dialog box. Check button and hit OK.

Action buttons
Action buttons

To add our actions we are going to right click the button and select actions.

In our actions pane we want to add the follow action script code:

on (release) {
getURL("JavaScript:popup();");
}

Now save your movie and publish. Go to File and Publish.

Now we are going to add our JavaScript to our HTML file. Just copy and paste the code below changing the options as necessary for your project. You will need to replace the http://flashnewz.com with the url that you want to use for the pop-up window.

Java Script to be inserted in the <head> tag of your HTML.

<SCRIPT LANGUAGE="JavaScript">
function popup() {
window.open('http://flashnewz.com','','toolbar=no,location=no,status=no,menubar=yes,
scrollbars=no,resizable=no,width=10,height=10,left=0,top=0');
}
</script>

And that's all folks!


About the Author:
Having created the outlines for FlashNewz and FLADownloads, John has become a strong voice in the Flash Community. His reviews and tutorials give great insight and knowledge to readers around the world. He has a keen eye for what's hot and what's not in the Flash world. He has also developed and continues to run his own flash portal as a side project to keep his mind on the Flash community

Being a key designer for advertising creative, he's got style when it comes to grabbing readers attention. With a proven track record, there isn't much this guy can't handle.

Close    To Top
  • Prev Article-Web Design:
  • Next Article-Web Design:
  • Now: Tutorial for Web and Software Design > Web Design > JavaScript > Web Design Content
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Geek Tutorial
     

    Blogging Tutorial

      RSS Tutorial
      Podcasting Tutorial
    Graphic Design Tutorial
      Coreldraw Tutorial
      Illustrator Tutorial
      3D Tutorials
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial/ Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial/ Articles
     

    XML Style

      AJAX Tutorial
      XML Mobile
    Flash Tutorial/ Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial/ Articles
      Linux Tutorial
      Symbian Tutorial
      MacOS Tutorial
    Personal Tech
      Hardware Tutorial
      Software Tutorial
      Online Auction