CBT Cafe Logo  

CBT Cafe > Flash > ActionScript

Flash: Using Load Movie

Version: Flash 5
Source Files: Download
Objectives: Using Load Movie to load external movies as part of a Flash website.
Tools & Techniques: Load Movie, loadMovie, levels, buttons

Preview Final Movie Here

This lesson will demonstrate how to load external Flash movies. A major reason to load external movies is file size. By loading only the movies you or your visitors want to view, you can keep your initial movie size considerably lower. For example, in this tutorial we created a sample Flash website with separate, external movies for the About, Product, and Contact sections.

If a viewer only wanted to view the info on Products, he/she can click the Products button and that info will load without having to wait for the other areas to load as well. This technique is great for larger, more content-rich movies.

We'll assume you know how to create a basic Flash movie for this lesson.

Step 1: Getting Started

I created 5 movies for this example: 1 main movie and 4 additional content movies.

  1. Create one main movie to serve as the "container" or background movie
  2. This movie will always remain at Level 0 and we'll load the other 4 movies on top of it at Level 1

Step 2: Open the movie you want to use as the background or main movie

This will be the movie that you use to load the other movies on top of. In my example, it's "loadmovie.swf"

I don't have any buttons on this movie, only graphics and some text. Instead of using a button to load the first movie, I'm going to apply a frame action that loads the first external movie when the movie begins.

Step 3: Create the Load Move action at Frame 1

  1. To load the first movie when the main movie is launched, create a frame action that loads the movie.
  2. Click in Frame 1 of the background movie and in the Basic Actions Panel, click Load Movie. The loadMovieNum action appears in the first line.
  3. In the URL field, type in the exact name of the first movie you want to load. In my example, I typed in: main.swf. This is the path to the movie so be sure to type the path correctly. I'm using relative paths here to keep things simple.
  4. For Level, choose any number greater than 0. Level O is where the background layer is stored so you want to load your other movies on top of it. You can load the other movies into Level 0 but it will replace your current background movie. There are times when that's more appropriate, but in this example, we'll just load the other movies in Level 1, above our main, background movie.

Be sure to include the ".swf" extension. Keep the Expression box unchecked.

The Framerate of the original movie is the framerate all other movies will play, regardless of their individual settings.

Page 1 | Page 2 | Page 3

We've added 4 New Movies to our Flash 5 source files cd! These include detailed videos on:

1. Tell Target/With
2. Dynamic Text 1
3. Dynamic Text 2
4. Animated Fly Out menu Part 2

About the CDROM:
These movies are the SAME content found in our Flash 5 tutorials, but the quality is clearly better than the streaming, web-compressed format we have online with Frame Rates up to 20 TIMES FASTER and CD-ROM quality AUDIO!

More Info...




Home | Dreamweaver | Fireworks | Flash | Photoshop | Elements | PowerPoint| Ebay | QuickTime Pro | Flash 5 CD | Fireworks MX CD | QuickTime Support | Contact

Copyright © 1999-2011 CBT Cafe, All rights reserved

Flash®, Fireworks™, and Dreamweaver® are registered trademarks of Macromedia, Inc. in the United States and/or other countries
Photoshop®, Photoshop Elements® and Illustrator® are registered trademarks of Adobe Systems, Inc.
QuickTime® is a registered trademark of Apple Computer, Inc.
Ebay® is a registered trademark

CBT Cafe | Multimedia Learning | Interactive Graphics