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

Chapter 11. Arrays

Using and understanding arrays is a milestone concept that will catapult you into another level of programming skill. It’s almost like the difference between riding a one-speed and a 10-speed bicycle… between a piece of toast and a waffle… or between playing checkers and chess. I’m just saying arrays are a big deal. Your programming career can be separated as “before arrays” and “after arrays.” Unlike the way we’ve used variables so far (to store one value at a time), arrays enable you to store as many individual values as you want—and of any data type. In addition to storing a lot of information in one place (an array variable), you can quickly access any individual item to see or change its value. Furthermore, the Array object has a host of methods that let you perform fancy operations on the contents of an array. For example, you can—almost instantaneously—sort the contents alphabetically if you want.

Although arrays are not the most advanced feature of ActionScript, they are perhaps the most valuable because they’re so easy to use. If storing values in variables is convenient, storing lots of values in one array is invaluable. In addition to the useful operations you can do with arrays, you’ll find that the syntax you learn (as with so much other syntax) is easily applicable to other parts of ActionScript.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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