# Classes - Quick Question

**URL:** https://forum.kirupa.com/t/classes-quick-question/233232
**Category:** flash
**Created:** [July 21, 2007, 5:58pm UTC](https://forum.kirupa.com/t/classes-quick-question/233232 "2007-07-21T17:58:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Dan0](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@Dan0](https://forum.kirupa.com/u/Dan0)
#### Post date: [July 21, 2007, 5:58pm UTC](https://forum.kirupa.com/t/classes-quick-question/233232/1 "2007-07-21T17:58:24Z")

</div>

Hey  
If I have one Main class that initiates a second class like this:

```auto
Main.as
package {
 public class Main extends Sprite {
  function Main() {
   var a = new SecondClass
  }
  public function coolStuff() {
   trace("A");
  }
 }
}

SecondClass.as
package {
 public class SecondClass extends Sprite {
  function SecondClass() {
   //do the coolStuff function in the Main class
  }
 }
}

```

How do I get my SecondClass to call the coolStuff function in the Main class? I tried doing somthing like “Main.coolStuff()” or “parent.coolStuff()” but it does not inherit and I can not be bothered with inheritance because I do not want to script my stuff like that. For example, I want a textFormat class to be defined on the Main class but used in all classes in my code, how do I do this? Im sorry to ask such a noob question but Im new to OOP and scripting ideas like this.

Thanks for your help,  
Dan
