Flash AS3 Tutorials Center | Interesting Flash Animation Tutorials | Valuing Flash Animation Tutorials | Flash ActionScript and Animation Home

AS3 Beginner Tutorials | AS3 Basic Lessons | AS3 Valuing Courses | AS3 Components Tutorials | AS3 and PHP Interaction Tutorials
AS3 Practical Tutorials | AS3 Animation Techniques | AS3 Transition Effects Tutorials | AS3 Download Upload Files | AS3 Particle Systems
Communication Between Flash Movies with AS3 | AS3 and JavaScript interaction | AS3 Matrix Transformation | AS3 Physics Simulation Tutorials

Play and Stop Flash Movie Clip with ActionScript 3

This tutorial series show how to use Flash ActionScript to control Flash Movie Clip.

Please update flash player to view this Flash ActionScript tutorial!

Flash Tutorial Content:

The most basic idea of controlling a Flash MovieClip on stage is to Play it, Stop it, Go To next frame, Go To previous Frame, Go To a certain frame and continue the playing and stop it. This tutorial shows how to do it.

The completed Flash Movie of this Flash ActionScript tutorial is shown as above. Please play around to see how it works.

Flash ActionScript Codes:

// Play Square MC Button
play_btn.addEventListener(MouseEvent.CLICK, playSquare);

 

function playSquare(evt:Event) {

square_mc.play();

}

 

// Stop Square MC Button
stop_btn.addEventListener(MouseEvent.CLICK, stopSquare);

 

function stopSquare(evt:Event) {

square_mc.stop();

}

 

// Square MC Go To Frame 15 STOP Button
gotoFrame15Stop_btn.addEventListener(MouseEvent.CLICK, gotoFrame15Stop);

 

function gotoFrame15Stop(evt:Event) {

square_mc.gotoAndStop(15);

}

 

// Square MC Go To Frame 15 PLAY Button
gotoFrame15Play_btn.addEventListener(MouseEvent.CLICK, gotoFrame15Play);

 

function gotoFrame15Play(evt:Event) {

square_mc.gotoAndPlay(15);

}

 

// Square MC Go To NEXT Frame Button
gotoNextFrame_btn.addEventListener(MouseEvent.CLICK, gotoNextFrame);

 

function gotoNextFrame(evt:Event) {

square_mc.nextFrame();

}

 

// Square MC Go To PREVIOUSFrame Button
gotoPreviousFrame_btn.addEventListener(MouseEvent.CLICK, gotoPreviousFrame);

 

function gotoPreviousFrame(evt:Event){

square_mc.prevFrame();

}

 

// Add Event Listener to stage
addEventListener(Event.ENTER_FRAME, countFrame);

 

function countFrame(evt:Event){

// Display the current frame number
output_txt.text = ("The Current Frame Number is now: " + square_mc.currentFrame);

}

Download Flash Source File:

Flash Source File control-movie-clip-1.fla

Remarks:

In this Flash ActionScript tutorial, we learn how to control Movieclip - Play, Stop, Go To next frame, Go To previous Frame and Go To a certain frame