Welcome to my actionscript snippet library!

Actionscript Snips is a small repository of actionscript code that aims to save developers and designers time when developing a website.  

Factorial


function factorial(n):Number {
if (n < 2) {
return 1;
}
return n*factorial(n-1);
}

trace(factorial(3)); //Outputs 6

1 comments:

Anonymous said...
This comment has been removed by the author.

Post a Comment