niaM:3SA
Ok, so typing out Math.round(Math.random()*10) is quite annoying when you want to get a random whole number between 1 and 10. Here is a super-crazy complicated class I wrote in about 10 hours that will make it a lot easier:
package {
public class randomFunction {
public function randomFunction() {
}
public function random(integer:int):int {
return Math.floor(Math.random() * integer);
}
}
}
save that in the same directory of your game .fla file and use it like so:
var Math:randomFunction = new randomFunction()
and then, when you want to get the random number:
trace(Math.random(10))