A function that calculates the area of a rectangle and returns the value as a number
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
trace(calculateArea(2,3));
}
function calculateArea(nA:Number, nB:Number):Number {
var nArea:Number = nA * nB;
return nArea;
}
}
}
Related examples in the same category