One of the many ways Flash movie designers keep the size of their Flash Timelines manageable is to embed Flash Small Web Format (SWF) movies inside other Flash movies, or play a movie in a movie. External SWFs (known as a "child") load into parent movies inside container components, such as UILoader. In movies designed to use ActionScript 3.0 (AS3), Flash's built-in scripting language, you can place the component wherever you want on the Timeline and then configure it to load the desired external SWF.
- Skill level:
Other People Are Reading
Things you need
- Adobe Flash CS3 or later
Open an existing Flash ActionScript 3.0 FLA file or create a new one in Flash.
Go to the frame in the Timeline panel where you want your external movie to play. Right-click the frame and choose "Insert Keyframe" from the pop-up menu.
Click "Window" on the menu bar and choose "Components."
Drag "UILoader" to the Stage.
Click "Window" on the menu bar and choose "Components Inspector."
Select the instance of UILoader on the Stage. Change the "scaleContent" value in the Parameters column to "false" (click the drop-down and choose "false"). This tells Flash to let the external SWF set the size of UILoader.
Drag the component to the desired position on the Stage, or use the "X" and "Y" fields in the Position and Size section of the Properties panel to place it precisely. The coordinates correspond to the upper-left corner of the component.
Click the "value" field to the right of "source" in Component Inspector and type the path to the external movie file. For example, if the external file is in a subdirectory named "flash," the path would be "/flash/moviename.swf."
Test your movie. If the path and file names are correct, the external SWF should load and play.
Tips and warnings
- You can create many UILoader instances and load several external SWFs in the same scene without writing any scripts.
- You can load external movies into UILoader on a button click with a simple ActionScript event handler that advances the movie to the frame where you placed UILoader.
- When you deploy your movie to a web server, make sure you maintain the file paths. For example, if your movies are in a subdirectory on your computer, they should be in the same subdirectory on the server. Otherwise, your external movies will not play.
- It is important to upload all the files, including the external SWFs. Otherwise, they will not be available to the main SWF movie.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for