Doing math in ActionScript

What I’m shooting for here is averaging values, based on two other values that I enter in two different text values.
Example:

Games Played: 10
Points: 50

Points Per Game: 5.0

How would I code it so that when those two values are entered, the “Points Per Game” is automatically calculated?