Buttons are objects categorized as Symbols and are used to enhance user interaction. Their timeline consists of four frames or states namely Up, Over, Down, Hit which are respectively the frame to display when the button is inactive, when the user brings his mouse over it, when the user clicks it and the area in which the button should accept mouse events...

Creating a Button ::
To create a new button, select "New Symbol" from the insert menu or use the keyboard shortcut, Ctrl+F8 and choose Button as the type for the new symbol. 
Select the Up frame and draw on the stage, in a way you would like the button when idle. 
Now right click the Over frame and select "Insert KeyFrame" this should create a duplicate of the Up frame which you can edit or you could select "Insert Blank KeyFrame" if you wish to edit from scratch either way, make the Over frame reflect how you would like the button to look when the mouse moves over. 
Similarly, edit the Down frame and the Hit frame.
Note that the Hit frame is not essential for the button to function but then it's advised you use it to define the button area. This can be done by drawing a shape in the hit frame to reflect the buttons area of effect. 

Now that we are done with creating our button, we need to write some actionscript to tell the button how it need to react to Mouse Events (when a mouse moves over, mouse button is pressed, etc.).

Before we do that,we need to move back to the main stage by clicking on the Scene1 link toward the top right corner of the window as show...

Now open the library (Ctrl+L) where the button we just created is listed and drag it and drop it on the stage of the main movie. This should create an instance of the button. 
Open the properties window (Ctrl+F3) and select the button on the stage. In the properties pane, change the instance name to "my_btn".

Now Select the first frame from the timeline, right click and select "Actions" this should open the actions pane where you will need to put the following code.


Code ::

my_btn.addEventListener(MouseEvent.CLICK,handleClick);

function handleClick(e:MouseEvent)
{
trace("my_btn was clicked !!!");
// code to be executed on click here
}


 Code Description ::
my_btn.addEventListener(MouseEvent.CLICK,handleClick);

In this line, we are assigning an Event Listener to the button (instance name : "my_btn") to listen to the Events Stream and call the function "handleClick" when a MouseEvent, "CLICK" is registered.
In simple words, the function is called when the user clicks the button we put on the stage.
Syntax for initializing an eventHandler :: Object.addEventListener(Event,function_name);

function handleClick(e:MouseEvent)
{
trace("my_btn was clicked !!!");
// code to be executed on click here
}

Here, we are defining a function by name handleClick which will be called when a mouse click event is registered.
Here a parameter variable, "e" of the type MouseEvent is set because the eventHandler function passes an event variable as arguments and the function needs to accept it though we dont use it in the code.


Now that you have a basic idea about using buttons and listening to events, you can extend your knowledge to different events and also edit the basic handleClick function in this tutorial and extend it for more complex operations.