Working with Movie Clips and Buttons > Using actions and methods to control movie clips > Dynamically creating an empty movie clip |
![]() ![]() ![]() |
Dynamically creating an empty movie clip
To create an empty movie clip on the Stage while a movie plays, use the createEmptyMovieClip
method of the MovieClip object. This method creates a movie clip as a child of the clip that calls the method. The registration point for a newly created empty movie clip is the upper left corner. Although the createEmptyMovieClip
method behaves similarly to attachMovie
, you don't need to provide a linkage identifier because you aren't adding a symbol from the library.
To create an empty movie clip:
1 |
Select a frame, button, or movie clip to which to assign the action. |
2 |
Choose Window > Actions to open the Actions panel if it isn't already open. |
3 |
In the Actions toolbox (at the left of the Actions panel), click the Objects category, the Movie category, the MovieClip category, and the Methods category, and double-click |
4 |
For the |
5 |
Enter values for the following parameters: |
![]() |
For |
![]() |
For |
myMovieClip.createEmptyMovieClip("newMC", 10); |
![]() ![]() ![]() |