Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author Miguel Panos
»  Title: Tarta
»  Description: It is a circle graph or pie chart that takes the data entered by user
»  More by Miguel Panos


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 4839 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

»  AuthorDeft Creative Ltd
»  Link: Home Page
»  Description: Portfolio site for .DeftCreative Ltd. A UK based web design studio specialising in flash websites, games and interactive CDROMs. With an emphasis on making things different.


Random Links | Add your own Flash Related Links
Flash Tutorials 1484 Tutorials 7 New Tutorials Added!
What's New | Top100

» Making Automatic Training Screen Capture Easily
» Create Undersea Life Animation
» Making Deinterlace Video with a low bitrate Easily
» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» Unknown Tag: Title10
Random Tutorial | Add Site


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Actionscripting

Categories Cool popup window
Author: Peyman Hooshmandi Raad | Website: www.2advanced.4t.com |

 
Page 1
1

Opening a cool pop up window

 

 

 

 

 

Opening a cool pop up window

By: Peyman Hooshmandi Raad

[preview]

Sometimes the swf file is not that much big to fit the browser's window and you know how ridiculous is a 300x450 swf file inside a maximized window with toolbar, status bar, address bar, all kinds of buttons and so many other unnecessary stuffs around it. You certainly have seen those cool popup windows that exactly fit what they have inside them. I am trying to tell you the secret behind these popups, step by step. Well, It is only a small JavaScript that does everything. Let's get started.

Step 1. Create a button symbol in flash and attach this code to the instance on stage:

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

This code calls a JavaScript function -pop- that is inside the html file hosting it. That means when the button is released the JavaScript function pop will be executed.

Step 2. Save your fla file and name it opener.fla. publish your file (Press F12) and open the HTML file that has just been created where you had saved the current fla file. Insert the JavaScript Code below, between the <Head> </Head> tags. 

 

  IMPORTANT NOTE : DON'T COPY AND PASTE THIS CODE. REWRITE IT.

<SCRIPT LANGUAGE="JavaScript">
function pop() {
window.open("popup.html","","height=200,width=200,left=0,top=0");
}

</script>

Step 3. Now you have your button that will open a popup window named popup.html and it is the time for you to create another HTML file named popup.html that will be opened as I mentioned above. Ok this HTML file can also contain a swf file or whatever you put inside it But this HTML file will be opened with height and width you specify in the JavaScript code. That means you have to adjust what popup.html contains with your JavaScript code.

Settings. You can adjust the popup's height (200 in the example)

               You can adjust the popup's width (200 in the example)

               You can specify the popup's position (x=0 & y=0  in the example)

Troubleshooting. The opener.swf must be executed inside it's HTML file. I mean if you simply double click the opener.swf it opens your windows flash player not the Browser's window. The second thing is that you must specify the complete address of the page you want to open in the JavaScript code for example: 

            window.open("http://www.2advanced.4t.com/popup.html", . . . .

Final Note. I have included a complete set of Source files that I myself Have created for this tutorial. You can use it in case of any misunderstanding. By the way if you have any problem creating a popup window send your question to flash5developer@yahoogroups.com and  will answer your question. 

 

GOOD LUCK

Peyman Hooshmandi raad

http://www.2advanced.4t.com

Copyright © 2000-2001 Peyman Hooshmandi Raad

 

 

 

           

        

1

» Level Intermediate

Added: : 2001-12-15
Rating: 8.26 Votes: 123
Hits: 17702
» Author
Nothing to say!
» Download
Download the files used in this tutorial.
Download (7 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments