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

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 » 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 4
«prev 1 2 3 4 5 6 next»

Manipulating, Moving, Resizing, Scrolling, and Animated effects for the window Once opened

The following reference provides ways to control you popup window once opened. You can either place the code on buttons that control the popup or on frame actions that will manipulate the popup window at certain time's when the movie is playing. We'll start off with some simple functions then move onto some more complex ones. You can also combine these with the previous section and have the various affects occur when the popup is loaded.

Move previously opened Window

on (release, rollOver) {
getURL ("javascript:NewWindow.moveBy(30,0); NewWindow.focus(); void(0);");
}

The above code will move a window you previously opened 30 pixels to the right (horizontal). The main code that controls this is NewWindow.moveBy(30,0); The (30,0) represents the X and Y coordinates you want to move the window to, respectively. The NewWindow.focus(); is also used to bring the window to the front of the browser each time you move it. If this part was left out the window would still move, but it would be behind the parent window so you would not see it move. Both on (release, rollOver) where used in this example - meaning that if a person rolls over the button that this code is located on the popup button will move 30 pixels to the right.

You can use the same basic method to Scroll or Resize a popup window as well. The only thing that would change would be the moveBy(30,0) part. To scroll this would be scrollBy(30,0) and to resize it would be resizeBy(30,0). The scrollBy one is probably one of the most interesting and useful because you can scroll to different parts of the page you opened with the popup window - all controlled by the parent movie. Also the (30,0) are just arbitrary numbers - you can use any numbers their that you want - for example moveBy(300,230) would cause the movie to move 300 px to the right and down 230 px.

One of the most important parts of the above code is that you use the same window object to reference the popup that you originally created the popup window with. In this case that would be 'NewWindow'. It should be noted that you can use any name for the window object as you want - as long as you keep it consistant.

Close previously Opened window

on (release) {
getURL ("javascript:NewWindow.close(); void(0);");
}

This just closes the window that you originally opened from a button in the parent Flash movie. Again it's important to keep the window object variable names the same. To close a window from itself (meaning the button is located in the same window you are closing) you can just leave out the 'NewWindow' variable name and use getURL ("javascript:close(); void(0);");

Shake the previously opened Movie

on (release, rollOver) {
getURL ("javascript:NewWindow.focus(); for (i=10; i>0; i--)
{ for (j=6; j>0; j--) { NewWindow.moveBy(0,i); NewWindow.moveBy(i,0);
NewWindow.moveBy(0,-i); NewWindow.moveBy(-i,0); }} void(0);");
}

Probably the best effect. This effect shakes the popup window for specific intervals and shakeness (couldn't think of better word).

The first thing that we do is bring the popup window to the front of the browser, like always with NewWindow.focus(); Then we use two 'for' loops to move the window back and forth and up and down really fast. You can change the settings by changing the values for i and j.

Animated Move, Resize, and Scroll

on (release, rollOver) {
getURL ("javascript:NewWindow.focus(); for (j=150; j>0; j--) {
NewWindow.moveBy(2,1.33333333333333); } void(0);");
}

The above function shows how to create an animated Moving window. This will move your popup window across your screen. Like always we use the focus(); command to move the window to the front before we move it. Then we use a 'for' loop to move the window across the screen in small increments. In this case the variable j indicates how many times it will incrementally move. By increasing j to say j=300 will increase the smoothness of the move creating smaller increments. Watch out though if you make j to large you'll freeze up your computer and get stuck in an infinite loop.

This is basically the same code used for the Animated Resize and Animated Scroll. To change this over to Animated Scroll or Animated Resize you would for example change the NewWindow.moveBy( portion to NewWindow.scrollBy(.

«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