Main class

**************************************************************************
Joachim Schnier (Flashscript.biz)
class Main (Event pattern)
*****************************************************************************/
package 
{
	import flash.display.Sprite;
/*
*	Main Class
*	Document class for movie
*/
	public class Main extends Sprite
	{
		public function Main ():void
		{
/*
* We place all objects on the stage. Note that we hide the DisplayModul 
* in a separate Sprite to make it more complex.
*/
			var am:AbstractClass = new AddModul();
			am.x = 25;
			am.y = 25;
			addChild(am);
			var dm:AbstractClass = new DeleteModul();
			dm.x = 175;
			dm.y = 25;
			addChild(dm);
			var mc:Sprite = new Sprite();
			addChild(mc);
			var dism:AbstractClass = new DisplayModul();
			dism.x = 50;
			dism.y = 75;
			mc.addChild(dism);
/*
* This will not be executed. "myObject" is only open for objects
* which extend the AbstractClass. 
*/
			var myObject:Sprite = new Sprite();
			myObject.addEventListener ("sendMessage", processEvent);
		}
		private function processEvent (event:Event):void
		{
			trace ("Main");
		}
	}
}