Posted By

withinmedianl on 01/12/11


Tagged

array total


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

chus
kure69


calculate the total of all numbers in Array


 / Published in: ActionScript 3
 

  1. // returns the total of all numbers in array as 1 number
  2. private function arrayTotal(input:Array):Number
  3. {
  4. var total:Number = 0;
  5. for(var i:Number = 0; i < input.length; i++)
  6. {
  7. total += Number(input[i]);
  8. }
  9. return total;
  10. }

Report this snippet  

You need to login to post a comment.