Next I will talk about the as syntax.
First, let everyone understand that the as syntax is case sensitive.
For example, gotoandplay () is correct and gotoandplay () is incorrect.
The spelling of keywords must be consistent with the syntax, so it is easy to do, because the keywords are displayed in different colors in the flash as panel.
A lot of Flash birds may start to complain. What can they do? I have a solution here, that is, back-to-back. Don't shed tears of grievance. We come here. You can remember it after two more times.
Here, we need to develop a good habit of programming from the very beginning, such as adding a semicolon after each statement. If possible, add comments to complicated statements. Annotation example
// This is a comment, but only one row is allowed
/* This is also a comment, and many lines can be written */
Next, we will introduce several types of syntax.
1. Several common control scenarios, suchCopyCodeThe Code is as follows: Play (); // play the time axis pointer
Stop (); // stop the timeline pointer inProgramFrame at the time of triggering
Gotoandplay (); // jump the pointer to a frame and continue playing
Gotoandstop (); // Let the pointer jump to a frame and stop at that frame
Nextframe (); // move one frame down
Prevframe (); // move one frame forward
The above are all methods.
Method? Solution: for example, we call it a way to solve the problem of ELE. Me. We call stop () a method to solve the problem of stopping the timeline pointer. We call the above several methods to solve the problem of timeline pointer movement.
2. syntax for controlling attributes. There are many, I want to list a few
_ X
_ Y
_ Alpha
_ Width
_ Name
... And so on.
All the above are attributes.
Attribute? Example. We call your height an attribute to identify your height. We call your weight an attribute to identify your quality. We call _ x an attribute to identify the x-axis coordinates of the target. We call _ Alpha an attribute to identify the transparency of the target ...... I am so cool, alas.
3. syntax for controlling the statement flow, such
If (condition ){
// Execute the code here when the conditions are met
} Else {
// Execute the code here if the condition is not met
}
For (I = 0; I <n; I ++ ){
// Execute the code n times
}
While (condition ){
// Always execute the code here when the condition is met
}
And so on. These are basic syntaxes and the basis of.
4. Other methods and custom methods.
I cannot describe all the syntaxes here, because there are too many syntaxes. For details, refer to the help manual provided by flash. We can only get familiar with it in future applications. Here, you have a basic concept. At the end, I will add comments to each sentence.
Let's review what we need to remember this time:
The as syntax is case sensitive.
Method.
Attribute concept.
(To be continued)