Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Parts of a Class

Even the most introductory ActionScript books cover the creation of custom classes (see Table 1-5). Often, this is to demonstrate the use of the language. It would be beyond the scope of those books to ensure that you have the proper object-oriented mindset as you construct your classes. With this in mind, don't be too anxious to skip ahead if you feel you may already be familiar with constructing classes.

Image

Figure 1-4. The expected syntax and structure to properly define a custom class

On line 4 in Figure 1-4, you used the keyword class to signify that the following definition relates to a class. The class directive can include four additional modifiers, not including its visibility. By default, you don't see any of the keywords other than class in your editor, because everything in brackets in Figure 1-4 is optional; these elements let you make custom modifications to the class.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint