A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11303 Flash Movies | 7 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: VICENTE VERGARA SILVA
» Title: JORGE ASBUN BOJALIL WEBSITE INTRO
» Description: THIS IS BRIEF A 3D INTRO MADE IN 3D MAX STUDIO FOR A PERSONAL POET WEBSITE. ENJOY.
» More by VICENTE VERGARA SILVA


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

Featured Site

» Posted in the Flash Kit Links section
» Title: 3D Jobs
» Description: Free job forum for jobs in Films, Video Games, Multimedia and jobs in flash animation and scripting.


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

» Make flash video player for broadcasting live streaming video / TV on website
» How to convert the project file of Flash Demo Builder 2.0 into FLV file
» FLV to PSP for Mac - How to convert YouTube video to PSP on mac
» How to Convert FLV to MP4 for Playback on iPod
» how to download and convert youtube video to AVI with Leawo Free FLV converter
» Flash Multi-player Game Tutorial - TicTacToe
» How to make Flash elearning tutorials with screen recorder?
» Fader API:Slideshow with MovieClips on stage
» How to convert MS PPT file into an FLV File
» Unknown Tag: Title10
Random Tutorial | Add Site

Network Design Manager
The Computer Merchant, Ltd
US-VA-Hampton

Justtechjobs.com Post A Job | Post A Resume


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.25 Votes: 122
Hits: 17698
» 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