package{ import flash.display.Sprite; public class Main extends Sprite{ public function Main(){ trace(factorial(3)); } function factorial(nOperand:Number):Number{ if(nOperand > 0){ return nOperand * factorial(nOperand - 1); } else{ return 1; } } } }