# Nice question about classes

**URL:** <https://forum.kirupa.com/t/nice-question-about-classes/177280>\
**Category:** flash\
**Created:** [January 31, 2006, 6:46pm UTC](https://forum.kirupa.com/t/nice-question-about-classes/177280 "2006-01-31T18:46:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ayman](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Ayman](https://forum.kirupa.com/u/Ayman)\
**Post date:** [January 31, 2006, 6:46pm UTC](https://forum.kirupa.com/t/nice-question-about-classes/177280/1 "2006-01-31T18:46:51Z")

</div>

Ok Guys, I have an interesting question for you. I have 2 classes, one extending the other. However, when I trace the values, Im not getting what I expect. It’s kind of tricky, but I’m sure someone would be able to catch the problem straight away

My first class:

> class File{  
> function File()  
> {}

public var name:Array = new Array(); //String;  
public var address:Array = new Array(); //String;

}

My second class:

> class Folder extends File{  
> function Folder()  
> {}

public var description:String;

}

On the main timeline:

> var n:File = new File();  
> n.name[0] = “little”  
> n.address[0] = “poopoo”

var b:Folder= new Folder();  
b.description = “Some kind of description for whatever”  
b.name[0] = “big”  
b.address[0] = “forty”

trace(n.name[0]) // it shows forty. How on earth does that happen??

So you see, after the trace, I’m getting the value for the other class. Why is that happening???
