Control MovieClip Inside Another MovieClip with Flash ActionScript 3
Sometimes, a Flash MovieClip will be contained inside another MovieClip. This Flash ActionScript tutorial shows how to control a MovieClip that residue inside another MovieClip.Flash Tutorial Content:
Like Sprite, a Flash MovieClip is also a container. That is, a MovieClip can contain another MovieClips inside it. This Flash ActionScript tutorial shows how to control a MovieClip that residue inside another MovieClip. In our example shown above, the small circle is also a MovieClip. The small circle MovieClip has it's own timeline and animation.
The completed Flash Movie of this ActionScript tutorial is shown as above. Please play around to see how it works.
Flash ActionScript Codes:
// Play Circle MC Button
playCircle_btn.addEventListener(MouseEvent.CLICK, playCircle);
function playCircle(evt:Event) {
// In other words circle_mc is inside square_mc
square_mc.circle_mc.play();
}
// Play Square MC Button
playSquare_btn.addEventListener(MouseEvent.CLICK, playSquare);
function playSquare(evt:Event) {
}
Download Flash Source File:
Remarks:
This Flash ActionScript tutorial shows how to control Movieclip that contained in other Movieclip.