Actionscript count and trace the number or arguments passed to a function

[as]
var totalArgs = arguments.length;
trace(“Number of Arguments passed = ” + totalArgs);
for (var i:Number = 0; i < totalArgs; i++) { trace ("Argument "+i + ": " + arguments[i]); } [/as]