Flash MX/ActionScript Graphics Tutorial (11)

Source: Internet
Author: User
Tags reset
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.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.