Math.newProperty

Hello,

I just bought the ActionScript Cookbook from O’Reilly, and on chapter five it starts adding properties to the Math class, such as


Math.randRange = function(minNum, maxNum, decPl){
//content for the new property would go here
}

but when i try to add flash give me a “There is no property with the name 'randRange '.” error. This might be a new rule with flash 8 (which i have)?

So, i guess I don’t understand why it’s giving me this message, if a popular published book often refers to doing such a thing.

and would something like this fix the problem:??

randRange.prototype = new Math();
randRange = function(minNum, maxNum, decPl){
//content for the new property would go here
}

anything to help me understand the problem i am running in to would greatly be appreciated.