A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11337 Flash Movies | 1 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Bugra Ozden
» Title: Skatalog v9 - product catalog
» Description: Create your product catalog easly and publish on your website or Create your image gallery, documents list, portfolio. Fully XML Driven
» More by Bugra Ozden


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

Featured Site

» Posted in the Flash Kit Links section
» Title: Creative DW Image Show PRO
» Description: Creative DW Image Show PRO is a Dreamweaver extension which enables the user to create multimedia presentations. It combines the features of the popular Creative DW Image Show with the ability to add professional text effects to slides (similar to After Effects). The product is very customizable: the user can choose the duration of the transition effects, the slide motion start and end position, zoom and panning type for both images and texts.


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

» Make a Flash Slide Show Screen Saver
» Simple flash making tutorial for thanksgiving
» Create flash banner for website
» 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
» Unknown Tag: Title10
Random Tutorial | Add Site

Sr Instructional Designer D2L-Moodle,Clearance
WSI Nationwide, Inc.
US-NJ-Fort Monmouth

Justtechjobs.com Post A Job | Post A Resume


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

Search Tutorials


Tutorials Tutorials » Dynamic_Content

Categories JavaScript Pop-up windows (no external scripts) in Flash - a definitive guide
Author: Jeffrey F. Hill | Website: http://www.flash-db.com |

 
Page 3
«prev 1 2 3 4 5 6 next»

Adding Custom Functions and Effects to your popup window

Their is really no limit to the amount of effects you can add to the popup window your opening. I'll try to go over a few relevant examples and what makes them work. Then you can create your own or use the Auto-Code Generator. Some effects are not cross browser compatible and some may not work when opening pages outside of the domain where your movie is located.

Move window to new position 1000 milliseconds (1 second) after it loads

on (release) {
getURL ("javascript:NewWindow=window.open('ShowPopup.php','newWin','width=400,height=300,left=0,top=0,
toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No');  NewWindow.focus();
setTimeout('NewWindow.moveTo(200,300)',1000); void(0);");
}

The above script allows you to 'move' the window to a new location at a certain time after it opens. The setTimeout part controls the time delay (in milliseconds) to wait until that part of the code is activated. The NewWindow.moveTo(200, 300) part tells the window where to go, the (200,300) part is the same as the X and Y coordinates of where you would like your window to move to. It is important to note that we always reference the popup window by the object name we gave it in the first part of the script 'NewWindow'.

Display an Alert before window is opened then scroll to a specific point 3 seconds after it loads

on (release) {
getURL ("javascript:NewWindow=window.open('ShowPopup.php','newWin','width=400,height=300,left=0,top=0,
toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No');  alert('Flash Rules'); NewWindow.focus();
setTimeout('NewWindow.scroll(0,400)',3000); void(0);");
}

The above code will open a new window with the various properties as indicated. Then display an Alert box that contains the text 'Flash Rules' before the window opens. The alert('Flash Rules'); is the code that will activate the alert. Then we add the code setTimeout('NewWindow.scroll(0,400)',3000); to Scroll the window down by 400 px - the (0,400) part represents the X and Y coordinates you want to scroll by. The setTimeout part adds a delay to the scroll, in this case the delay time is 3000 milliseconds or 3 seconds, before the scroll happens. It can be important at times to add a delay because you can't scroll a page that has not loaded.

Open window, Resize it after 1 second, then Close it after 6 seconds

on (release) {
getURL ("javascript:NewWindow=window.open('ShowPopup.php','newWin','width=400,height=300,left=0,top=0,
toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No'); NewWindow.focus();
setTimeout('NewWindow.resizeTo(500,500)',1000);  setTimeout('NewWindow.close()',6000); void(0);");
}

The above code opens a popup window, the resizes it after 1 second to the new dimensions of (500,500) instead of 400 x 300. This is done by the code: setTimeout('NewWindow.resizeTo(500,500)',1000);. Then it is closed after 6 seconds by the code setTimeout('NewWindow.close()',6000);. The most important thing to notice about the delay close code is the NewWindow.close() This is the basic code that will close a popup window.

As you can see by now their is really no limit to the amount of effects that you can add. The main limitation is not with the JavaScript or Flash but with Browser compatibility. The resizeTo and scroll functions will not work with all browsers. You can get fairly creative by mixing and matching functions and portions of the code. The next section deals with manipulating and adding more effects to the Popup window you recently opened from the parent Flash movie.

«prev 1 2 3 4 5 6 next»

» Level Intermediate

Added: : 2002-01-09
Rating: 8.81 Votes: 149
Hits: 2300
» Author
Jeffrey Hill is a freelance web developer from Boulder, Colorado. He specializes in creating and developing dynamic database driven Flash content and applications. Specialty's include SQL, PHP, Perl, and XML.
» Download
Download the files used in this tutorial.
Download (0 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, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs