• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13. Building a Code Library > Basic Class Packages in AS2

Basic Class Packages in AS2

Ah, the last section of the last chapter. And I’m bringing up a topic that will easily fill another book twice the size of this one. I do want to orient you to AS2, but not as some afterthought or futile attempt to cram it all in. Rather, the best thing I can offer is an introduction to how AS2 is structured and how you can get started putting it to use. For me, the hardest aspect of learning is taking the first steps to apply all the tidbits I gather by reading or looking at others’ solutions. This section attempts to put things in perspective so that you can get a good idea where things fit.

Anyway, AS2 is a formalized set of rules for ActionScript. The intention is for ActionScript to be more like other object-oriented languages such as Java and C#. It’s not quite AS1 with more stuff (although, there are several added script elements). Instead, AS2 enforces syntax rules to even your old AS1. If you set your Publish settings to AS2, for example, you’ll be able to use things such as strong data typing and the new Error object. However, with this setting, something that may have worked in AS1 will no longer work. For example, in MX you could use the following:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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