A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11336 Flash Movies | 2 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Surjit Dhami
» Title: Book
» Description: Book
» More by Surjit Dhami


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

Featured Site

» Posted in the Flash Kit Links section
» Title: All-American Rejects
» Description: Get to know this great band by exploring their "practice room".


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

» Create xml slideshow with free template
» How to Insert a Multilingual Subtitle Into Your Flash Video Studio
» How to Create Cool Halloween Slideshow
» Debugging flash using the Firebug console
» Create Flash Slideshow on Blogger
» FLASH TRICKS IN WEB ADVERTISING: FLASH BANNERS
» HTML Photo Gallery Tutorial
» Create your first flash site – PART 1
» How to Make a Flash Photo Gallery
» Unknown Tag: Title10
Random Tutorial | Add Site

Webmaster (IL)
Next Step Systems
US-IL-Chicago

Justtechjobs.com Post A Job | Post A Resume


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: 781
» 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
 
   
 

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs