3 Forum Posts by "newgroundz2012"
At 11/2/12 11:09 AM, newgroundz2012 wrote: I'm making a game. This is the script of one of the movie clips:
on(release) {
gotoAndStop(random(4))
}
Wherein 'random (number)' would be a random no. from 0 to the number specified. This would mean that each frame would have a 33.3% chance of being picked and shown, in the case of a movie clip of 3 frames. When 4 frames, 25%, 5 frames, 10% and so on.
Try it. It works.
Great. I computed wrong. For 5 frames, it's 20%, 10 frames 10%. Anyhow, it works. Try it!
At 8/9/10 02:26 AM, ThePigeonMaster wrote:At 8/8/10 11:54 PM, K-Guare wrote: Math.floor(Math.random() * (max - min + 1)) + min;Thanks, K-Guare. I was actually using this script
on (release) {gotoAndStop(random(4));}
But yeah, the Math.floor command was the more appropriate in this case. Thanks :)
I'm making a game. This is the script of one of the movie clips:
on(release) {
gotoAndStop(random(4))
}
Wherein 'random (number)' would be a random no. from 0 to the number specified. This would mean that each frame would have a 33.3% chance of being picked and shown, in the case of a movie clip of 3 frames. When 4 frames, 25%, 5 frames, 10% and so on.
Try it. It works.
At 8/10/11 05:33 PM, loopchocolateman1234 wrote: I'm sorry, I'm only 12 and I have a really hard time learning AS, could someone possibly teach me? (Starting from the basics).
http://loopchocolateman1234.newgrounds.c om/news/post/612292
Don't worry. I'm 10 and I have such a loooooong way to go to be a Flash professional. Conclusion:You're not alone.

