you need to give your assets instance names in order to control them. on your stage, select your exampleBtn instance and give it a name "exampleBtn" in the properties panel. however, it's best to give your instances a different name than its class name for reusability.
another cause of this problem is that your document class file is not being called by your .fla. select your stage and enter the document class name in the properties panel.
example: your document class file is called DocumentClass.as, so you enter "DocumentClass" in the class field in the properties panel. if DocumentClass.as in in a folder called Classes that is in the same directory of your .fla, the class filed in your properties panel will be "Classes.DocumentClass", and your .as package header will be "package Classes" instead of just "package"
make sure your document class file is saved and in the appropriate location before debugging.
finally, the problem might arrise simply because your stage hasn't initialized while you're calling your assets. this requires you to add an ADDED_TO_STAGE event listener, calling your assets afterward.
package Classes
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent; //import MouseEvent
public class DocumentClass extends Sprite
{
public function DocumentClass()
{
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(evt:Event):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
//exampleButton.visible = false;
exampleButton.addEventListener(MouseEvent.CLICK, clickEventHandler);
}
private function clickEventHandler(evt:MouseEvent):void
{
trace(evt.currentTarget.name + " Clicked. Event Details: " + evt);
}
}
}