In the movie below click the nexct button to learn to make tea.
The buttons move to the first frame, back obne 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 "clickable" also.
INDEX, Click Event: A spinning ball, Buttons for Navigation, Frame Event: A Spinning Star, A Moving Ball, The trace() command, How to Make Tea: A Demo Movie
Next lesson: Variables in Actionscript