Home | Contact Us | Store

Flash ActionScript 3 Tutorial:
Load MovieClip from Library to Empty MovieClip

This flash tutorial shows how to load a MovieClip from the Library to an Empty MovieClip on the Stage with Flash ActionScript.

Your flash player version is too old to see this Flash ActionScript tutorial!

Flash Tutorial Content:

In previous flash ActionScript tutorial, we showed how to load MovieClip from the library to the stage. In this flash tutorial, we first create an Empty MovieClip on the stage with ActionScript. Then we load an MovieClip from the Library to the Empty MovieClip with ActionScript.

The completed Flash Movie of this tutorial is shown as above.

Flash ActionScript Codes:

/*
Preparation: Create Linkage for the MovieClip

STEP 1: Prepare MovieClip
You already prepared a MovieClip in the library
In this example, the name of the MovieClip is called "Tree"

 

STEP 2: Create Linkage
Select the "Tree" movieclip from the library window
Select "Linkage..." from the pop up window
The Linkage Properties window appear
Check the "Export for ActionScript"
Enter "Tree" in the Class field.

 

Preparation: Create an empty MovieClip

1. Select "Insert" from the menu.
2. Select "New Symbol" from the drop down menu
3. The "Create New Symbol" window pop up.
4. Enter "emptyMC" in the Name field. Select MovieClip.
5. Select "Scene"
6. Drag the "emptyMC" to a desired position on the stage (e.g. 150, 210)
7. Give a new instance name "emptyMC_mc" to this empty MovieClip
*/

 

// Create a new MovieClip
var myMovieClip:MovieClip = new Tree();

 

// Add the new MovieClip to the empty MovieClip
// so that we can see it.
emptyMC_mc.addChild(myMovieClip);

 

// Set the location if required
//emptyMC_mc.x = 250;
//emptyMC_mc.y = 210;

Download Flash Source File:

Flash Source File load-mc-2.fla

Remarks:

This Flash ActionScript tutorial shows how to load MovieClip from the library to an empty Movieclip on the stage. Sometimes you may have some MovieClips in the Library. The next Flash ActionScript tutorial will show how to load a random MovieClip from the Library to an empty MovieClip on the stage.

ActionScript Load Movieclip from Library