Variables | tips
Usually in writing actoinscript, always look forward to some corner of this hint or something. Lest you think of some common words.
Actually there are a lot of tricks.
As an example:
If you want to enter a MovieClip instance name, you can then get code hints for common properties
such as:. _currentframe. _alpha. _x Unloadmovie (), etc.
As a general method, you can declare this instance to be named the movie clip, as follows:
var movie:movieclip//Disclaimer movie for movie clips
Then after you enter: Movie. Instance name + "." A code hint will pop up
But now you don't have to declare it.
It's a good idea to name a variable (or instance name) as a [*_ variable type abbreviation ] format.
As long as you change the movie clip's instance name to: MOVIE_MC can use the same effect as above
In the Actions panel, enter the MOVIE_MC. //Instance name + "." A code hint will pop up
Similarly, MovieClip uses _MC, and other types are shown below
Movie clips: MovieClip => _MC
Buttons: Button => _btn
Character: String => _str
Text: Text => _txt
Arrays: Array => _array
More can be found in the help document from the standard wording
Note: One of the benefits of writing this way is to improve the readability of your code, and you can see the type of the variable at a glance.
Author: Wood (13tds@163.com)
http://bbs.flash8.net/blogs/mutoo/
Reprint please indicate the source