Writing Recursive Functions
package{ import flash.display.Sprite; public class Main extends Sprite{ public function Main(){ trace(factorial(3)); // Displays : 6 } function factorial(i:uint):uint { if (i == 0) { return 1; } else { return (i * factorial(i-1)); } } } }