Simple Classes question

Hi,

I made a simple example of three classes, because I keep running into the same problem again and again. Suppose you have two MovieClips in the library with the linkages Circle and Rect. And both of them have their own custom class. My problem is that I don’t know how to ‘communicate’ between those classes. Here is the example (it doesn’t have all the code I have tried sofar :-)):

Main.as:

 
package{
 
 import flash.display.Sprite
 
 public class Main extends Sprite{
 
  private var circle:Circle;
  private var rect:Rect;
 
  public function Main(){
 
   circle= new Circle();
   addChild (circle);
   rect= new Rect();
   addChild(rect);
   rect.x=300;
 
  }
 }
}

Circle.as:

 
package{
 
 import flash.display.Sprite
 import flash.events.MouseEvent
 
 public class Circle extends Sprite{
 
  private var rect:Rect;
 
  public function Circle(){
   addEventListener(MouseEvent.CLICK, clickCircleListener);
  }
 
  private function clickCircleListener(e:MouseEvent):void{
   trace(e.target);
 
   //how can I address 'rect'  from here?
   trace(rect)//trace null
   trace(this.parent.rect);//rect is undefined property
   //for instance, how can I  make  'rect' invisible?
 
  }
 
 }
}

Rect.as:

 
package{
 
 import flash.display.Sprite
 import flash.events.MouseEvent
 
 public class Rect extends Sprite{
 
  public function Rect(){
   addEventListener(MouseEvent.CLICK, clickRectListener);
  }
 
  private function clickRectListener(e:MouseEvent):void{
   trace(e.target);
  }
 }
}

Or is it not the way to go to communicate between classes like this?

thanks!

Jerryj.