A flash effect of imitation CCTV

Source: Internet
Author: User
Tags setinterval
Look at this one here.
   http://www.cctv.com/culture/index.shtml

The picture automatically transforms, the mouse points to the different link picture also transforms accordingly.

The tutorial that I am going to give this effect may be a little bit deep because the action in fact everyone is the same is never to the meeting if you see the action on the back to say you can never learn flash!

I don't believe you. Ask our Mars Secretary. How many difficulties did he experience when he first learned? Only from the shrimp into the big shrimp! Thank the Secretary for his strong technical support he's a good silver!

No more wordy, here we go!

First of all, I want to mention the concept of nesting. Many people have learned that there are nested in the programming language, which means that there is a layer of nested meaning because the following will be used but I just follow my own understanding to say I do not know if you can understand it?

In this example, there is a button and four corresponding pictures

Create a new movie clip named "Gray" in layer 1, draw a white box without the edge of the following figure: (Note that the x Y axis in the property panel is changed to 0 this is for the convenience of management to get into habit OH)

Layer 2 is a text layer written "Picture 1" words

Then divert to do 3 film clips named "Red" "Green" "green" as the following figure:



The following is an example of a movie clip with the name "Gray", the rest is similar!

The new movie clip is named "dimmed" to drag the movie clip named "Gray" to the inside or to the place where the property coordinates are x:0 y:0 and then 10th true Insert key really in 1th really choose tonal adjustment to white right key 1th True Select Create motion tween make a white to gray gradient dot last true Press F9 to add a command stop ();

A new movie clip named "Master File" below

The layers are shown below:

Specific explanation:

PP layer with gray to red to green to blue four movie clips each takes up a true

The TXT layer puts the corresponding explanatory text of the four clips above

The action layer actually has only one command stop (); Divided into four true and the above one by one corresponds

and make a button. Two really make a shadow effect to be realistic

Go back to the main scene and watch the timeline screenshot:


Specific explanation:

The Xian layer is a few straight lines for the shadow effect.

The BTN layer has four buttons. Select the 1th button to add the following code by F9:

On (rollover) {//mouse over, then play the picture MC 1th frame, and clear off the delay function;
Pic_show.gotoandplay (1);
Clearinterval (timer);
}
On (RollOut) {///mouse out of time to restart the execution of the delay function ~
Timer = setinterval (next_pic,2000);
}

The remaining three are similar just to replace 1 with 2 3 4

The MC layer has the movie clip "Master file."

The as layer code is as follows:


function Next_pic () {//Custom function, used to control the playback of the image MC, functions named Next_pic
if (Pic_show._currentframe = = 4) {//If the current frame is frame 4th, go to the first frame;
Pic_show.gotoandplay (1);
}else{//if not, play the next frame;
Pic_show.nextframe ();
}
}
Timer = setinterval (next_pic,2000); The Next_pic function is executed once every 2 seconds. The timer is the ID of this delay function to easily remove it from the back.

CCTV's flash and website connection just added a transparency of 0 button on the button to add a connection I will not elaborate

Click here to download the source file


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.