> Hi,
> 
> Why is it when I use Math.random to generate 10 random 
> integers I get the same pattern of numbers almost every time. 
> Starting the SWF movie ten times and I have 6-8 times the 
> same pattern of numbers. What's going on there?

Most randomisation algorithms are based on a 'seed' value which is passed
through a complicated function to produce a new result. This allows
programmes containing random numbers to be tested. I don't know about AS3,
but certainly up to now there's been no way to specify the random seed, and
by the look of your test, it's reset when Flash restarts (you might want to
compare the browser with the standalone player, though). 

You can specify the randomseed for the BitmapData.noise and perlinNoise
functions, so you could use these to create more variable data. 

Danny

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to