Calling public methods in classes (AS2)

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. :slight_smile:
With other words - is there any possibility to call a public class from Design in Control class without this?


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!