My Flash Resource – New Ideas and News for Applying Flash to Complex Gaming Apps

Latest News and Developments

April 17, 2008

Inheritance VS Composition Class Model

by @ 2:37 pm. Filed under Actionscript 2.0 OOP, Flash Articles

When using Classes in Actionscript it is important to understand the relationships between classes, namely inheritance and composition.

Inheritance is where one class inherites the properties of another class, such as the example below. Snowboarding and surfing are both types of extreme sports and inherit properties such as being fast-paced and dangerous.

inheritance.jpg


Composition
is when one class is contained inside another class. For example, the class ‘person’ may contain a class for ‘feet’ and one for ‘hands’.

composition.jpg

Comments are closed.

My Flash Resource - A continually growing collection of tutorials, thoughts and interests of a Flash Animator and/or Developer.

categories:

other:

New Feedburner Feed!


Feel free to syndicate.

Learning Material

Flash Resources:


Listed on BlogShares
  • Resources