What is?

Source: Internet
Author: User

AS is short for Action Script. It is a programming language. First, we should not be afraid of it. First, let's learn how to control the automatic playback of a video loop. In this order, we formally enter the AS order. Make a very simple mobile animation, for example, to make a circle moving MC (MovieClip) (the meaning of the video clip) select the animation to stop. (note, the selected token must be a key token.) open the action panel and enter stop () in the blank document. Therefore, an & alpha; is generated immediately on the token, you have succeeded. Press Ctrl + Enter! It turned out to be so simple, but don't be happy. We should be good at thinking, just AS you can think about experiment, so we can think like this:, we set the AS in this region. AS is like a policeman executing commands. He is standing there. AS long AS you come to him, he will faithfully execute the tasks he should execute, what is this simple AS task? That is, "stop". Why can't I stop it before it reaches him? Because he hasn't gotten to his website yet, he has no right. The book often says that once it is triggered, it will be executed. Now let's take a good look at today's content, perform the following exercises. 1. Animation for moving images in the scene is the one, the second, and the three... Next, try to be in the front and middle. Set stop () on the key marker at different locations. 2. Similarly, MC is the first and the second ....... Similarly, set stop () in exercise 1 and drag MC into the scenario! I almost forgot. Why is there another () behind stop? The answer is No. Why? Where can I say "stop? It is represented by parentheses. Enter a number in the brackets. If the number is a few, it stops at the hour. If there is no number, it stops at the hour. You don't have to experiment here. You can't do the experiment anymore, we will talk about it later. In short, stop (); contains two meanings: 1. stop 2. Actually stop there. Without parentheses, it does not know that it is parked there, so it simply does not execute the command, it must have () as if we have a common two-digit notation, 2 should be written as 02, this is because the computer is very standard. Well, at last, if you are not familiar with the AS panel, I will not talk about it and then go to our official study.

II. What do I mean by three AS types? I. I, first, learn to write the AS (1) on the button. For example, if there is such a piece of code (also called script or program) on (press) {gotoAndPlay (1)}, what does it mean? On is a button event, and press means press. GotoAndPlay refers to the process of transferring to and playing a video. When you press the mouse, you can jump to and play the first video. You can understand what you mean. If you don't do it, it becomes a theory, now we use the above source file as a button, create a new button for a simple animation for moving images, drag the symbol into the scenario, and place it on a new layer. Click the button to open the action panel, on the panel, Enter the above statement and press Ctrl + Enter to try again. OK! The AS format written on the button is on (event) {code to be executed}. We must write it in this format, in this regard, computers are not as flexible as humans. A single sentence can be expressed in multiple ways, and computers must follow its requirements. Now you know the role of the numbers in the brackets, why is the number in the brackets after the stop in the preface incorrect, because there is no command to go to and play, so you can only stop at the current primary node instead of other secondary nodes, but now you are switching to and playing the video. You can set it as needed. Remember: the AS format written on the button is on (event) {code to be executed} now let's perform the following exercises to consolidate 1. Complete the animation after several images are played in the scene, give a try, and make several buttons, cause different clicks to play in different regions. 2. Set the button to the last region, so that your original loop without stopping MTV can be clicked before replay.

(2) Let's further study how we can achieve this. There are several buttons and click a button to play a connected MC. Just like browsing a webpage, there are various methods, now let's learn one. The rest will be understood by friends. 1. Create three MC, and add stop () to the first commit of each MC () 2. Create three buttons and return to the scenario. Place the Three MC labels on the first, second, and third blocks, respectively, and add stop () to each listener (), let's get the instance name for each MC. (how do I get it? Click MC, open the attribute panel, and enter the symbols in the box under the video clip. For example, a, B, c, and 3. Drag the three buttons into the scenario, on the second layer of the first release 4, select the first button, open the AS panel, enter on (press, release) {gotoAndStop (1) _ root. a. play ();} also adds on (press, release) {gotoAndStop (2) _ root. b. play () ;}add on (press, release) {gotoAndStop (3) _ root to the third button. c. play ();} 5. Press shint + enter to try the above example. Let's talk about the relevant syntax. First, we further consolidate the script format on (event) {code to be executed} written on AS. Second, the MC on the three timelines all wrote the stop () command, which indicates that automatic playback cannot be performed, because each timeline does not contain a single timeline, it contains a lot of clip content, which is a video clip. The MC to be played must be instructed before playing the video. Otherwise, stop () is not added () so it's no different from flashing three images. Once again, we set the case name for each MC. Why should we set the case name? Here we also want to talk about the path problem. The command to be executed in this syntax is {gotoAndStop (3) _ root. c. play ();} jump to and stop in the third timeline. play a video on the root Timeline. root indicates the root timeline, _ root. c. describes the absolute path of movie c. What does path mean? The path is used to find the target. The expression is the operation symbol ". for example, the path of Tiananmen is Earth. asia. china. beijing. in this way, a level-1 and a level-1 person can search for Tiananmen, similar to the timeline. C video editing, "it's just simpler. After learning the simplicity, we can grasp the complexity. Well, there are still relative paths about paths, in the future, we should know why we should give MC a case name. If there is no case name, we cannot find anything to play and execute commands, the dot operator not only indicates the path, but also indicates the properties and methods of calling an object. For example, the stop () operator indicates the method and the playing method. Well, the simple interaction you want can be implemented now. We will discuss it further in the future.

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.