A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11336 Flash Movies | 2 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Surjit Dhami
» Title: Book
» Description: Book
» More by Surjit Dhami


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

Featured Site

» Posted in the Flash Kit Links section
» Title: All-American Rejects
» Description: Get to know this great band by exploring their "practice room".


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

» Create xml slideshow with free template
» How to Insert a Multilingual Subtitle Into Your Flash Video Studio
» How to Create Cool Halloween Slideshow
» Debugging flash using the Firebug console
» Create Flash Slideshow on Blogger
» FLASH TRICKS IN WEB ADVERTISING: FLASH BANNERS
» HTML Photo Gallery Tutorial
» Create your first flash site – PART 1
» How to Make a Flash Photo Gallery
» Unknown Tag: Title10
Random Tutorial | Add Site

Trading Customer Accounting (IL)
Next Step Systems
US-IL-Chicago

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
 
   
 

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs