Home >> Production >> Flash and ActionScript >> ActionScript Part III

ActionScript: Basic Actions part III

  • load movie; unload movie

Continued

This is where Flash can get complicated, when you begin working with multiple timelines and symbols. You can see how essential pre-planning becomes once your project gets more involved.

As we have learned from movie clip symbols, Flash can play separate timelines. But not only can Flash play the timelines of movie clip symbols, Flash can also load other Flash movies into its timeline and play those as well.

Load Movie

Follow this example to learn how to load a movie into another movie.

You can download these files if you want to follow along:

geturl.fla

geturl.swf

maskmovie.fla

maskmovie.swf

To unload a movie

To unload a movie, simply add an action, either a button or a frame action and double click Unload Movie, then select the level of the movie that you want to unload. In our example, we loaded the movie geturl.swf into level 1. When we click Play again, we will want to unload the movie in level 1 before reloading it, otherwise we'll have movies playing over top of each other.

 

What might you use this for? Look at the Flash site for my company: whirld new media and click on portfolio. Then click on some of the different numbers of projects. Each time you click a button, a movie is loaded with a thumbnail and description of that project. When you click the next number, that movie is unloaded.

By loading each project description as a separate movie, the overall file size of the Flash movie is greatly reduced. This way, users do not have to load a section of the site they might not be interested in.

Go on to Part IV, If Frame is Loaded