M > MovieClip.attachMovie

 

MovieClip.attachMovie

Availability

Flash Player 5.

Usage

myMovieClip.attachMovie( idName, newName, depth [, initObject] ) 

Parameters

idName The linkage name of the movie clip symbol in the library to attach to a movie clip on the Stage. This is the name entered in the Identifier field in the Symbol Linkage Properties dialog box.

newname A unique instance name for the movie clip being attached to the movie clip.

depth An integer specifying the depth level where the movie is placed.

initObject An object containing properties with which to populate the newly attached movie clip. This parameter allows dynamically created movie clips to receive clip parameters. If initObject is not an object, it is ignored. All properties of initObject are copied into the new instance. The properties specified with initObject are available to the constructor function. This parameter is optional.

Returns

Nothing.

Description

Method; takes a symbol from the library and attaches it to the movie on the Stage specified by MovieClip. Use the removeMovieClip or unloadMovie action or method to remove a movie attached with attachMovie.

Example

The following example attaches the symbol with the Linkage Identifier "circle" to the movie clip instance, which is on the Stage in the movie.

on (release) {
    thing.attachMovie( "circle", "circle1", 2 );
}

See also

MovieClip.removeMovieClip, MovieClip.unloadMovie, Object.registerClass, removeMovieClip