Chapter 6: Objects: Critter Attack


Overview

You probably have a decent idea of what objects are from our previous encounters with them. And because movie clips are a form of object, we've been using them since Chapter 2, "Flash ActionScript." Now it's time for a formal look at objects with no punches pulled.

ActionScript did not start out as an object-oriented programming language. Instead, it grew into that with the introduction of ECMA-262 script in Flash 5. Prior to that, ActionScript would have been called an iterative scripting language. Because of the late addition of objects into Flash, many details of their use seemed strange and unintuitive. Luckily, with Flash MX 2004, the treatment of objects is a little more intuitive than previous versions of Flash. We'll look at the concept of inheritance in Chapter 9, "Object-Oriented Programming with AS 2.0."

Before we dig in, I want to say that this chapter is intended to be usable as both a reference and a learning tool. For that reason, it's going to be long. After I talk about what objects are, I'm going to give an in-depth look at most of the objects available to us in ActionScript. It isn't necessary that you read and understand every object listed in this chapter. Some objects won't be used in our games ; therefore, if you want to skip around a bit after you have an idea of what objects are and how they work, feel free. You can always come back to this chapter later if you need to. If you do decide to skip over some of the objects that don't look useful to you, make sure you go over the introductory explanation of what objects are and how they work, as well as the MovieClip , Key , Mouse , and Color objects.

Without further ado, let's get into the subject of objects.




Macromedia Flash MX 2004 Game Programming
Macromedia Flash MX 2004 Game Programming (Premier Press Game Development)
ISBN: 1592000363
EAN: 2147483647
Year: 2004
Pages: 161

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net