# AS2.0 class help

**URL:** <https://forum.kirupa.com/t/as2-0-class-help/219626>\
**Category:** flash\
**Created:** [March 18, 2007, 8:46pm UTC](https://forum.kirupa.com/t/as2-0-class-help/219626 "2007-03-18T20:46:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![armyvisual](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@armyvisual](https://forum.kirupa.com/u/armyvisual)\
**Post date:** [March 18, 2007, 8:46pm UTC](https://forum.kirupa.com/t/as2-0-class-help/219626/1 "2007-03-18T20:46:18Z")

</div>

Hey guys,

```
Im struggling a little bit as im starting to try to impliment classes and things now, since i havent done so in the past :X

For instance, ive written a class to control my content panels on my site. They work well! Currently they controll all the positioning perfectly on there own.

What I am having trouble with, is how do i pass variables into my classes. For instance, my main content panel, has variables in the class:

```

public var contentState:Number;

```
Now, what I would like to do, is have movieClips on my stage, or 'buttons' that will be able to change 'contentState' within my class.

How do i go about passing these variables? Right now i have;

' _root.panel.contentState = 1; '

```

This doesnt do anything! :cantlook:

Anyway - one more question!

For instance - lets say I have, text fields inside of a movieclip, how would i control these through my class? I tried defining them as;

’ public var titleText:TextArea; ’

then later on in the class assign 'titleText = “Blah…”;  
However, i get an error saying:

The class or interface ‘TextArea’ could not be loaded.  
public var titleText:TextArea

If anyone could give me some insight that would great!

Thanks in advance-

Mike
