package  
{
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	
	public class Main extends Sprite
	{
		private var myParticles:MyParticles;
		
		public function Main() 
		{
			button.addEventListener(MouseEvent.CLICK, onButtonClick);
			
			myParticles = new MyParticles();
			myParticles.mouseEnabled = false;
			addChild(myParticles);
		}
		
		private function onButtonClick(e:MouseEvent):void 
		{
			//Check to see if particles are active
			if (!myParticles.isRunning)
			{
				//Particles were not active, start them
				myParticles.start();
			} else
			{
				//Particles were already active, stop them
				myParticles.stop();
			}
		}
	}
}