Button components in MX 2004

Well, I 'm not very versed in actionscripting, and since the button component has changed since Flash MX, I don’t understand it.
I had a project where a button component (in MX) calculated a value when clicked. It’s click handler was onCalculate and on the timeline I had the following code:

function onCalculate () {
volume = Number(volume);
current = Number(current);
desired = Number(desired);
doseA = .0019*volume*(desired-current);
doseB = (doseA)*5;
doseA = Math.round(doseA*1000)/1000;
doseB = Math.round(doseB*1000)/1000;

}

Now, I don’t know how to do this in MX 2004. The components don’t use click handlers anymore. From reading forums this is the best I could come up with and it is obviously wrong (oh, what I am calculating is diffrent here):

myButtonListener = new Object();
myButtonListener.click = function onCalculate () {
width = Number(width);
depth = Number(depth);
desired = Number(desired);
bags = (widthdepthdesired)/7000;
}

       myButton.addEventListener("click", myButtonListener);

all I want to do is have flash perform this calculation when the button is clicked. It’s probably totally simple, but I don’t know how to do it.

thanks