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?
Almost looks as if the compiler sets pre-compiled numbers.

Using this ...

                        var str:String = "";
                        
                        for (var i:int = 0; i < 10; i++)
                        {
                                str += Math.floor(Math.random() * 100) + ",
";
                        }
                        trace(str);

... and running the SWF movie ten times, I get this ...

88, 87, 35, 69, 73, 11, 93, 40, 39, 19, 
43, 69, 70, 96, 39, 97, 8, 74, 29, 65, 
50, 32, 82, 45, 39, 74, 96, 5, 7, 9, 
50, 32, 82, 45, 39, 74, 96, 5, 7, 9, 
50, 32, 82, 45, 39, 74, 96, 5, 7, 9, 
50, 32, 82, 45, 39, 74, 96, 5, 7, 9, 
50, 32, 82, 45, 39, 74, 96, 5, 7, 9, 
88, 87, 35, 69, 73, 11, 93, 40, 39, 19, 
50, 32, 82, 45, 39, 74, 96, 5, 7, 9, 
88, 87, 35, 69, 73, 11, 93, 40, 39, 19, 
  
This is the first time I experience this.  Is there any solution to fix
this?

Thanks,
Sascha


_______________________________________________
[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