# Calling public methods in classes (AS2)

**URL:** https://forum.kirupa.com/t/calling-public-methods-in-classes-as2/268152
**Category:** flash
**Created:** [August 11, 2008, 12:05am UTC](https://forum.kirupa.com/t/calling-public-methods-in-classes-as2/268152 "2008-08-11T00:05:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Poco](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@Poco](https://forum.kirupa.com/u/Poco)
#### Post date: [August 11, 2008, 12:05am UTC](https://forum.kirupa.com/t/calling-public-methods-in-classes-as2/268152/1 "2008-08-11T00:05:10Z")

</div>

Hi everybody,

I have three classes:

1. MainComponent //core things, setting sounds, etc
2. Control //ads behavior to all buttons neccessary to control the movie
3. Design //takes care only about the layout, Stage.onResize, placing the elements, etc

In the MainComponent I initialized both classes, Control and Design as well. Now I have a problem. I would like to add a behavior to a button (that happens in Control class) that would call a public function in Design class. At the moment it is not possible because Control class has no reference to Design class. Is there any way how I can do it without a reference? I hope somebody gets what I mean and I do hope I explained it well. 🙂  
With other words - is there any possibility to call a public class from Design in Control class without this?

```auto

function MainComponent(){
   var D = new Design();
   var C = new Control(D); // <- passing the parameter = reference to Design
}

```

Thanks in advance for any comments or ideas!
