How to Load an SWF Within Another SWF File That Has AS3 Files Embedded
SWF files are Adobe Flash movie files. Adobe Flash is an animation and application development program. When you load an external Flash SWF movie in an existing SWF movie, the external SWF will automatically load and use any embedded AS3 (ActionScript 3.0) files. You don't have to do any extra programming or preparation to the external SWF. You can load an external SWF with Flash's built-in UILoader component.
Things You'll Need
- Adobe Flash Professional CS3 or later
- SWF file in which you want to load the SWF containing embedded AS3 files
- SWF file containing the embedded AS3 files
Instructions
-
-
1
Open the Flash file in which you want to load an external SWF.
-
2
Right-click the frame in the Timeline panel where you want to load the external SWF and choose "Insert Keyframe" from the popup menu.
-
-
3
Click the "Window" menu and choose "Components." This opens the Components panel.
-
4
Double-click the "User Interface" folder to open it.
-
5
Drag the "UILoader" component to the stage.
-
6
Go to the "Properties" panel and click "Component Parameters." This displays options for configuring the component.
-
7
Type the path and file name for the external SWF in the "Source" field.
-
8
Click the check box beside "scaleContent." This tells Flash not to scale the SWF to the size of UILoader. Instead, UILoader resizes itself to the size of the SWF.
-
9
Click the "Control" menu and choose "Test Scene." The SWF loads and plays. When the playhead gets to the frame where you placed UILoader, the external SWF loads and plays. It also loads and executes any AS3 files embedded in the external SWF.
-
1
Tips & Warnings
When you deploy the SWF to a Web server, make sure you also upload the external SWF and the embedded AS3 files. Otherwise, your movie will not play properly.
References
Resources
- Photo Credit Jupiterimages/Photos.com/Getty Images