Tutorial
Automatic switching of 2.3.2.2 pictures
1. Back to the main scene, drag and drop the movie clip that was made in the previous step into the scene and name it picture_mc, adjusting its length to 45 frames.
2, add a dynamic text, named Message_txt, we will use it to show the countdown, the countdown is complete, PICTURE_MC in the picture automatically switch. Also add a dynamic text called Caption_txt, which displays the caption of the picture, controlled by the movie clip picture_mc its own code.
3, a new layer, named for the countdown, adjust its length is about 45 frames, in 0, 15, 30 frames, respectively, add frame events, the code content is:
message_txt.text= "Picture will be switched in 3 seconds";
message_txt.text= "Picture will be switched in 2 seconds";
message_txt.text= "Picture will be switched in 1 seconds";
Add such code on frame 45th:
Picture_mc.nextframe ();
gotoAndPlay (1);
The previous three frame events are for the countdown, and the last 45 frames have two lines of code, and the first line lets the movie clip instance PICUTURE_MC one frame backwards. This will form a countdown to complete the effect of switching pictures. The next gotoAndPlay (1) function is to return to the first frame of the film and start a new round of Countdown.
2.3.2.3 Button control
1, add a new layer, named "button", adjust its length to 45 frames.
2, make three buttons, drag and drop them into the layer "button", named Play_btn, Stop_btn and REWIND_BTN respectively.
3, for the above three buttons to add a separate code like this.
On (release) {
Play ();
}
On (release) {
Stop ();
}
On (release) {
gotoAndPlay (1);
Pictures_mc.gotoandstop (1);
}
These three pieces of code, the first two are very direct, as long as the movie play or stop the operation is all right. The last paragraph is reset, there are two lines, because the film itself and the movie clip instances need to be reset, so a little wordy.