title: button with simple mouse click event giving error 1046 ,compile-time constant: MouseEvent. not found
body: <p>I am a newbie , </p>
  
  <p>i am very new to the whole actionscript(using 3.0)</p>
  
  <p>i have a button class and simply the main class</p>
  
  <p>no other actionscript</p>
  
  <p>button class name is graphic</p>
  
  <p>and script in it is </p>
  
  <pre><code>    package{import flash.display.MovieClip; 
      import flash.display.Sprite;
      import flash.display.SimpleButton;public class graphic extends SimpleButton
      { 
       function graphic()
       {
       }
       function hamza(event:MouseEvent):void
       {
       trace("hamza")
       }
       graphic.addEventListener(MouseEvent.CLICK,hamza);
      } 
  }
  </code></pre>
  
  <p>when i go to graphic linkage and enter graphic as class and click tick button
  firstly it says
  "The definition of this class was not found at ..path.."
  But still the script is made which is </p>
  
  <p>Here it says
  1046: Type was not found or was not a compile-time constant: MouseEvent.</p>
  
  <p>here i dont understand :(</p>
  
  <p>Looks like it dosnt recognise the mouse eventlistener mabye
  Please tell me the answer and also guide me on how to add this button on stage from main class(By addChild? but when i write in main class it not know what is button)</p>
  
  <pre><code>addChild(button);
  </code></pre>