31/10/2008import phoxer.Numbers.Random; Random.getRandom(10,20); //19.288095352239907 Random.getRandom(10,20,true); //15 trace(Random.getRandom(-10,-20); //-13.606321583501995 trace(Random.getRandom(-10,-20,true); //-12
/** by .:{PHOXER}:. http://www.phoxer.com v 2.5; */ package phoxer.Numbers{ public class Random{ public static function getRandom(min:Number,max:Number,estrict:Boolean=false):Number{ var rand:Number= Number(Math.random() * (max - min) + min); return (estrict)? Math.round(rand):rand; } } }
| ActionScript 3 |
No hay comentarios.----------------------------------------------
Si los tutoriales o los temas tratados en este blog te gustaron y quieres ayudarme a mantenerlos en linea puede hacer una donacion.
La donaciones son destinadas para mantener este blog y a los tutoriales Online.