Object oriented programming: Action Script

I imagine some readers might have no idea what a class or the term “object oriented” means, while others have been using classes in ActionScript (or other languages) for years. So as to not lose anyone, I’m going to try to cover all the basics. AS 2 OOP experts might want to at least skim this section, too, as there are quite a few changes in the way things work in AS 3. If you think you do not have any familiarity with classes, you may be wrong. If you’ve written any code in Flash, chances are you used several classes. A class simply refers to a type of object. MovieClip is a class referring to—you guessed it—movie clips. Text fields, movie clips, buttons, strings, and numbers all have classes.

A class basically has two things associated with it: properties (data or information) and behaviors (actions, or things it can do). Properties are essentially variables that hold information relating to the class, and behaviors are just functions, though when a function is part of a class, we usually refer to it as a method.

Advertisements

~ by denzil77 on July 4, 2008.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: