A simple MOD function for Flash

private function modfunction(n:Number,b:Number):Number {
  //****** MOD FUNCTION
  // n = number to apply the mod function to. b = base of for the mod function
  var result:Number = new Number();
  result = n - b*(Math.floor(n/b));
  return result;
}

Posted: June 2nd, 2008 | Author: | Filed under: Code Reference | No Comments »

Leave a Reply