I have a problem in Actionscript(Flex 2),Problems:1137: Incorrect number of arguments. Expected no more than 0 in line 6.Thanks,
Code:
package {
import flash.display.Sprite;
public class ExampleApplication extends Sprite
{
public function ExampleApplication( ) {
var average:Number = average (1, 2, 5, 10, 8, 20);
}
private function average( ):Number {
var sum:Number = 0;
// Loop through each of the elements of the arguments array, and
// add that value to sum.
for (var i:int = 0; i < arguments.length; i++) {
sum += arguments[i];
}
// Then divide by the total number of arguments
return sum/arguments.length;
}
}
}