Step by step, ActionScript 2.0 (3)

xiaoxiao2021-03-06  41

Tutorial

http://jinjunshi.blogchina.com/

How to edit the code of ActionScript 2.0? [Learning Objectives]: Learn to use Flash's action panel. In the tutorial II, we give you a simple look at the structure of the AS code. If the AS has several "elements" composition, let's take a look at the editing environment of the AS, the following picture is the editor of the ActionScript, that is, what we see Panel.

1. Open the editor of ActionScript If you don't see the above action panel, it is easy to open the menu in Flash MX 2004, "Window -> Development Panel -> Action" opens an ActionScript editor. Press directly according to the function key F9, (the master is like this, like shortcuts, I am not). Second, careful see what the panel is there? I used to be marked on the picture. If you have a test, you will understand what you are doing. 1, keywords, properties, methods, etc. in the script, etc., what should I do? As is very thoughtful, we can complete the code through a variety of ways. 1 Action Toolbox: Select the double click you need, the code ran to the editorial area, and also give you a prompt, know how other parts have been filled, it is like a choice question, it is very simple. . 2 Add a project tool to the script: It is the big " " number, the drop-down menu lists the item elements you need, you see the same as the action toolbox, the type is very fine. 3 Learn to take advantage of "." Symbol: Appropriate use "." Symbol, you can trigger code prompts. What is it right? First, take the skill of the name plus hyperfix to the "element" of the AS, add a special suffix, so that you will play a "." After entering the name. "The following you can choose. For example, we create a new component belongs to the movie clip type. We can give it a name mymc_mc. We call this movie clip in the AS to change some of its appearance properties. When writing code, the name is followed. " ", The prompt appears, the key is the suffix" _mc ". We will talk about the problems of these names. Second, define variables Description Type element type AS can be automatically identified. Such as sound, color, buttons, text, etc. Let's define a "container" var mymp3: Sound = new sound (); now type mymp3. You see prompts, the key is to do more: Sound, you can't automatically prompt: (4 Learn to use "(" When you enter some functions, then the left parentheses will have a prompt window to display it, list the parameters required for this function, so you won't make a mistake. 2, write code, The layout is not beautiful, a word "mess", how do I deal with? AS editor, you can give you a typographic version, click "Automatic Setting Format" tool to solve. 3, is there a mistake? "Check the syntax It is convenient than yourself in your line. 4, write code, don't understand where you want to ask the teacher? Ask for "help", go to the "script reference" tool, it gives you a good friend The teacher is much more, the key is to have patient go. 5, all written the code, how do I find it? This is easy, go to the "Script Navigator" column, want to modify the point. There are too many features of this editor. The key is to everyone. The key is to practice more, practice more, find the skills. Summary, this section, you know 2 o'clock, one, can see the action Panel. Second, know what the tools on the panel do, even if you understand the tutorial.

转载请注明原文地址:https://www.9cbs.com/read-73098.html

New Post(0)