Hey, what is the easiest way to create a random number between -200 and - 100 or 500 and 600?
I will be using it to randomly attach MovieClips either just to the left of the stage or just to the right.
Thanks,
Printable View
Hey, what is the easiest way to create a random number between -200 and - 100 or 500 and 600?
I will be using it to randomly attach MovieClips either just to the left of the stage or just to the right.
Thanks,
your name has so long decieved us so...
random(101)+500; // 500 to 600 inclusive
random(99)+501; // 500 to 600 exclusive (ie: 501-599)
random(101)-200; // -200 to -100 inclusive
random(99)-199; // ... exclusive
(non-depricated:)
Math.floor(Math.random()*101)+500;
Math.floor(Math.random()*99)+501;
Math.floor(Math.random()*101)-200;
Math.floor(Math.random()*99)-199;
.............................................
I dont want to post any more because then I wont be
<----------
1337!!!
The only 1337 (h4x0r) overweight in Flashkit. I rule.
:D
[Edited by senocular on 09-01-2002 at 05:45 PM]
prrrrrrrr senocular...
i am fatter than you :D
Cheers senocular, i couldn't quite get my head around that one ;)