Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author: Nick Kouvaris
»  Title: Znax
»  Description: Znax is a board game. Click 4 tiles of the same color and form squares as big as you can. You will erase all the tiles inside the square and collect points. Get maximum score if you make a square with game edges.
»  More by: Nick Kouvaris


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 4941 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

»  Author Agence WOP Digital Agency
»  Title: Electricdrum
»  Description: French WOP Agency, 3D websites, Flash (Papervision, Away 3D), event or institutional projects. The agency operates on all digital projects: consulting, design, graphic design, development, online communication. The WOP agency follows you on the implementation of original, creative and optimized digital projects.


Random Links | Add your own Flash Related Links
Flash Tutorials 1481 Tutorials 7 New Tutorials Added!
What's New | Top100

» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» How To Make A Fathers Day Slideshow
» How To Make A Transparent Background of Your Flash File
» Create Flash Banner With Text Disco Light Effect Today we will introduce you a Text Disco Light eff
» Unknown Tag: Title10
Random Tutorial | Add Site


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Actionscripting/OOP

Categories A Very Basic Introduction to Inheritance
Author: Kortex | Website: http://www.visualflowdesigns.com/ |

 
Page 5
«prev 1 2 3 4 5

Summary

So to sum up here is what I want to get across (not all of these points were shown in the examples):

  • Inheritance is a linguistic level method of code reuse.
  • Subclasses (those that extend another class via the extends key word) inherit based on access modifiers set in the parent class (the one being extended).
  • Both variables and methods can be inherited.
  • In actionscript (and many other object based languages) a subclass can only extend one parent class. In other words, I can't do class Son extends Father, Grandfather where Grandfather is the name of another class. Some languages do support extending more than one class and this is referred to as multiple inheritance if you want to look into it.
  • Inheritance chaining is allowed so I could do Class Father extends GrandFather and then Class Son extends Father which would result in Father having the variables and methods of GrandFather and class Son having the variables and methods of both Grandfather and Father.
  • Multiple classes can extend the same parent class. So Class Son extends Father and Class Daughter extends Father is fine, but note that while Son and Daughter would share (as in both have) the code inherited from Father, defining a method in Daughter does not mean it appears in Son and vice versa.

So that was a very basic introduction to inheritance. Again, much more could be, and has been, said about this topic. If you want to learn more, there are always people talking about such topics in the forums.

«prev 1 2 3 4 5

» Level Intermediate

Added: : 2007-12-10
Rating: 9.40 Votes: 5
Hits: 785
» Author
Kortex (aka Jeremy Wischusen) is a Flash/PHP developer for myyearbook.com and the lead software architect for the DigitallyU Digital Portfolio Software Suite.
» Download
Download the files used in this tutorial.
Download (7 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments