Tutorials Books Videos Forums

Change the theme! Search!
Rambo ftw!

Customize Theme


Color

Background


Done

Preloader and Transition for Dynamic Files

by claudio   | filed under Flash and ActionScript

This is an archived tutorial from the kirupa.com legacy collection. It covers software that may no longer be available, but it is kept online because the ideas still hold up.

This tutorial will explain how to build a flash website with external SWF content, transition effect and also preload the external content. The following animation should give you an example of what you will be creating:

[ click the buttons in the above animation ]
 

Site structure

The Flash site in this tutorial consists of the following:

Before we begin, you should download the partial source for the animation. Don't worry, the partial source still involves you creating objects, adding actions, and more:

The Interface

  1. Once you have done that, open file main.fla. Select the buttons layer. Then press F11 or go to Window | Library. Drag the button but1 and drop it on stage. Set its x coordinate to 10 and y coordinate to 50. Name this instance b1:


 
[ set the x and y coordinates ]

Repeat the same for the buttons named but2 and but3. Give them them the instance name b2 and b3. Also, ensure their coordinates are the following:

but2:    x=10 y=80
but3:    x=10 y=110

We are done with the buttons. This is how your stage will look like after completing the above step:
 

[ how your stage should look ]
 

  1. Select the mask layer. Open your library, drag the mask symbol and drop it on stage. Set its x coordinate to 100 and y to 40.
     

  2. Select the content layer. Open your library, drag the content symbol and drop it on stage. Set its x coordinate to 100 and y to 40. Name this instance content.
     

  3. Select the transition layer. Open your library, drag the transition symbol and drop it on stage. Set its x coordinate to 240 and y to 114. Name this instance transition. We are almost done now...
     

  4. Now we have to set the mask layer as a mask for the content and transition layers because we just want the transition and content to be visible inside the content area.

    Right click the mask layer. Select Mask. Right click on content layer. Select Properties. Now check the Masked option. This is how your layers will look like after this:

[ your layer structure ]
 

We are done with the interface. Now we have to add all the actions.


  1. Click the actions layer. Then press F9 or go to Window | Actions. Copy and paste the following code into the Actions dialogue box:

[ copy and paste the above code ]
 

  1. Click the content layer. Click on the content movie clip. Then press F9 or go to Window | Actions. Copy and paste the following code into the Actions dialogue box:

[ copy and paste the above code ]
 

  1. Click the transition layer. Double Click on the transition movie clip. Then select the frame 1 of the actions layer. Press F9 or go to Window | Actions. Copy and paste the following code into the Actions dialogue box:
                          _root.section =
    
      "profile.swf";
    
     
  2. Click on the frame 9 of the actions layer. Press F9 or go to Window | Actions. Copy and paste the following code into the Actions dialogue box:

         loadMovie(_root.section, _root.content);
         stop();
     
  3. Click on the frame 24 of the actions layer. Press F9 or go to Window | Actions. Copy and paste the following code into the Actions dialogue box:

         stop();

Code Explanation

The following sections provide a brief reasoning behind why the code was used and how it works in its used context.

[ Button ]

[ Movie Clip ]


You have just completed the tutorial. If you want to test it, upload it to a server. I have provided the final source for you to examine. 

If you have any questions, feel free to post them on the forums by clicking here.

Regards,

claudio

Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence, ads, and algorithm-driven doodads. A huge thank you to all of you who buy kirupa's books, became a paid subscriber, watch the videos, and/or interact on the forums.

Your support keeps this site going! 😇

The KIRUPA Newsletter

Thought provoking content that lives at the intersection of design 🎨, development 🤖, and business 💰 - delivered weekly to over a bazillion subscribers!

SUBSCRIBE NOW

Creating engaging and entertaining content for designers and developers since 1998.

Follow:

Popular

Loose Ends

:: Copyright KIRUPA 2026 //--