Flash MX/ActionScript Graphics Tutorial (iii)

Source: Internet
Author: User
Tutorial

1.3.3ActionScript Editor simplifies code writing features
1.3.3.1 visible element type automatic recognition

Let's take a look at a few small examples of the features of the Actionsctipt editor, first of all, ActionScript is an important feature of element naming, that is, based on the suffix of the element name to identify the type.
1 Open the Library Panel (shortcut key Ctlr+l), click the Add Symbol button in the lower left corner, select the symbol type "movie clip", and set the movie clip name to Movie_clip.



2 will then enter the editing status of the movie clip, do some drawing at random here, then go back to the main scene, drag Movie_clip from the library panel to create an instance of the movie clip in the main workspace, select the instance, and in its properties panel, set the instance name to Movie_clip_ INSTANCE_MC (note that the final suffix "_mc" is important and cannot be omitted).



3 Enter the name of the instance in the Script panel and enter a dot number ".", what do you see? A small check box to the processing, listing the current instance has some of the properties, with its help, our script editing work will greatly improve the efficiency.

Note that the properties listed here are related to the movie clip, which means that ActionScript has successfully identified the movie clip instance movie_clip_instance_mc.
It should be said that this is only a function of auxiliary editing, but even if you become a master in the future, it is best to name the elements in this way, because it can not only greatly improve the efficiency of code writing, but also reduce errors. For example, if you name an element in this way, but there is no pop-up window after the dot number, you must have made a mistake somewhere.
Elements with a suffix named "_MC" are recognized as movie clips, and similarly, the suffix "_btn" is recognized as a button, and the prefix "_tx" is most recognizable as text.



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.