Joke Collection Website - Mood Talk - How to make countdown QQ space

How to make countdown QQ space

Taking the opening of the Beijing 2008 Olympic Games as the countdown end time, the total number of seconds between the current time and the end time is calculated first, and then converted into corresponding days, hours, minutes and seconds respectively. Because the default frame rate of Flash is 12, "gotoAndPlay( 1)" is used in the code of 12 frame. Statement, which is used to arrange the countdown code to run once every second, so that the displayed countdown information is refreshed once every second.

On June 5438+065438+1October1day, 2005, the 29th Olympic Games, which will open in Beijing at 8 pm on August 8, 2008, ushered in an important historical moment of countdown 1000 days. BOCOG and all walks of life held the 1000-day release and countdown of the Olympic mascots, and welcomed them. This reminds us that the opening moment of the 2008 Beijing Olympic Games is coming to us quickly. In order to remember this moment, the countdown to the Beijing Olympic Games was specially realized with Flash. The specific steps are as follows:

1. Start Flash and create a new component named Countdown. Select "Movie Clip" in the behavior, and enter the component editing window after confirmation.

2. Click the text tool, select "Static Text" in the attribute, draw a text box, set the parameters of the text box, and enter the content "Now or before the opening of the 2008 Beijing Olympic Games".

3. Click the text tool, select "Dynamic Text" in the attribute, draw a text box, set the parameters of the text box, and set the variable to "DaoJiShiText".

4. Name the layer Countdown, and enter the following code in the first frame of the timeline:

EndTime = new date (July, August, 20, 0, 0, 2008);

//Define the countdown end time, that is, the opening day of the 2008 Beijing Olympic Games.

//Note that the month parameter is 0- 1 1 for February.

now time = new Date();

//Define the current time

zong = math . floor((end time . gettime()-now time . gettime())/ 1000);

//Gets the total number of seconds between the current time and the end time.

If (Zong & gt0)

{

Tian =Math.floor (Zong/(60 * 60 * 24));

//Get the remaining days

Zong = Zong-Tian * 60 * 60 * 24;

Shi=Math.floor (Zong/(60 * 60));

//Get the remaining hours

Zong = Zong-Shi * 60 * 60;

Fen=Math.floor (cases/60);

//Get the remaining minutes

Zong = Zong fen * 60;

Miao = zong;

//Get the remaining seconds

DaoJiShiText = string (day)+day+string (hour)+string (minute)+minute+string (seedling)+second;

}

5. Insert a key frame at the 12 frame of the time axis and enter the sentence "gotoAndPlay( 1)". .

6. Return to the main scene, drag and drop the countdown movie clip into the main scene, and test the operation. The effect is shown in the figure.