How to Play a Flash Movie Inside a Flash Movie
Flash movie FLA files can quickly get long and cumbersome—too many layers and frames to keep track of. One way to keep your Timeline under control is to load an external Flash Player SWF file into another movie during playback, rather than creating the entire movie all in one huge FLA file. Flash supports several ways to do this. An easy and straightforward method is to use Flash’s built-in UILoader component. UILoader is simple and works without a lot of scripting.
Instructions
-
-
1
Open an existing Flash FLA file or create a new one in Flash. Click the “New Layer” button (the plus-sign icon) in the Timeline to add a new layer.
-
2
Go to the frame in the new layer where you want your external movie to play. Click the frame to select it, and then right-click the selected frame and choose “Insert Keyframe” from the fly-out menu.
-
-
3
Click the “Window” menu, and then choose “Components.” This opens the Components panel.
-
4
Find the “UILoader” component in the Component panel list and drag it to the stage. With the component selected, change the “W” and “H” values in the Position and Size section of the Properties panel to match the dimensions of your external movie. (In most cases, your UILoader size should match the size of the external SWF, but you could come across applications where you might want to make it larger or smaller than the external movie file.)
-
5
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.
-
6
Click the "Window" menu and choose "Component Inspector." This opens the Component Inspector panel. Make sure the UILoader component is selected, and then change the scaleContent value under the Parameters tab to "false" (click the drop-down and choose "false"). This tells Flash not to re-size the external movie.
-
7
Click the “value” field to the right of “source” and type the path to the external movie file. (The relative path is important, so it’s a good idea to place the external SWF file in the same directory as the movie file loading it.)
-
8
Test your movie. If the path and file names are correct, the external SWF should load and play.
-
1
Tips & Warnings
You can create simple buttons and ActionScript to make the external movie play when a user clicks a button. This is a great way to create pop-ups.
You can use UILoader as many times as you need in the same scene without any scripting.
When you copy or upload your movies to a Web server, make sure you maintain the relative file paths. This is very important. Otherwise, your external movie won’t play. Keep it simple by saving all FLA and SWF files in the same directory before you deploy UILoader.
Make sure you upload all the files, including the external SWF, or the external movie won’t play.
References
- Photo Credit Ciaran Griffin/Stockbyte/Getty Images