# Properties in a user created class

**URL:** <https://forum.kirupa.com/t/properties-in-a-user-created-class/162826>\
**Category:** Uncategorized\
**Created:** [September 16, 2005, 3:53pm UTC](https://forum.kirupa.com/t/properties-in-a-user-created-class/162826 "2005-09-16T15:53:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![skjc](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@skjc](https://forum.kirupa.com/u/skjc)\
**Post date:** [September 16, 2005, 3:53pm UTC](https://forum.kirupa.com/t/properties-in-a-user-created-class/162826/1 "2005-09-16T15:53:09Z")

</div>

If I create a class and set up one property which is a variable initiated at the start of the class but not within a function or a constructor and I reference the property from the .fla in a for loop as:

Book is the class and myBook is the new object.

myBook:Book = new Book(); // (fla script).

for(var prop in myBook) {  
trace(prop);  
}

the .AS contains

Class Book  
{

var myProp:Number = 0;

function Book() {  
}

}

The trace does not return anything. However when I include myProp (the class variable) in a function (other than Book function) and call that function from the .fla then the trace works and I can see myProp.

I would be grateful if someone could explain: Do I need to include Class variables in called functions (methods of the Class) in order for them to be properties of the Class?

thanks in advance
