# Extending Classes and Adding Methods

**URL:** <https://forum.kirupa.com/t/extending-classes-and-adding-methods/30526>\
**Category:** flash\
**Created:** [September 10, 2003, 2:43am UTC](https://forum.kirupa.com/t/extending-classes-and-adding-methods/30526 "2003-09-10T02:43:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![grandsp5](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@grandsp5](https://forum.kirupa.com/u/grandsp5)\
**Post date:** [September 10, 2003, 2:43am UTC](https://forum.kirupa.com/t/extending-classes-and-adding-methods/30526/1 "2003-09-10T02:43:53Z")

</div>

I am trying to create a new object called SpaceCircle which will inherit all the properties of the MovieClip class and I also want to add some new functions to it such as .\_z . How would I go about doing this? This is the code i have  
[AS]  
spaceCircle.prototype = new MovieClip();  
spaceCircle.prototype.\_z = function(){  
//code here  
}  
[/AS]

Would this do the same sort of thing?

[AS]  
spaceCircle.addProperty(".\_z", \_root.getZ. \_root.setZ);  
[/AS]

And whats the difference between the 2? Thanks a bunch
