Events in ActionScript3

How to Make Tea: A Demo Movie

In the movie below click the next button to learn to make tea.

Get Adobe Flash player

The buttons move to the first frame, back one frame, next frame, and to the last frame. This type of movie can be used for any type of instructional movie.

stop();
this.btnFirst.addEventListener(MouseEvent.CLICK,goFirst);
this.btnBack.addEventListener(MouseEvent.CLICK,goBack);
this.btnNext.addEventListener(MouseEvent.CLICK,goNext);
this.btnLast.addEventListener(MouseEvent.CLICK,goLast);
function goFirst(e:MouseEvent):void {
gotoAndStop(1);
}
function goBack(e:MouseEvent):void {
gotoAndStop(this.currentFrame-1);
}
function goNext(e:MouseEvent):void {
gotoAndStop(this.currentFrame+1);
}
function goLast(e:MouseEvent):void {
gotoAndStop(this.totalFrames);
}

Experiment: Download the movie and add a few frames to the flowers and add code to make them "click-able" also.

NEXT: Variables in ActionScript3