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

Chapter 15. Using Basic ActionScripts > Using Object-Oriented Programming

Using Object-Oriented Programming

Objects are the key to understanding object-oriented programming. In object-oriented programming, an object is just as real as an object in this world. For example, your dog, or even your computer are objects that exist in the real world. Real-world objects share two characteristics with objects in the computer world: They have a specific state and behavior. For example, dogs have a state such as their name, color, breed, and if they're hungry. Dog behaviors would be: barking, fetching, and wagging their tails. All objects in the real and computer world have a behavior and a state.

Computer objects are modeled after real-world objects in that they also have a specific state and behavior. A software object maintains its state using one or more variables. A variable is an item of data named by an identifier, and a software object performs its behavior with methods. A method is a function associated with an object. Everything a software object understands (its state) and what it can do (its behavior) is expressed by the variables and the methods within that object.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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