To anyone who’s been playing with AS3…Here is my code
package {
import flash.display.Sprite;
import flash.text.*;
public class RandomTester extends Sprite
{
public function RandomTester()
{
var txt:TextField = new TextField();
txt.autoSize = TextFieldAutoSize.LEFT;
txt.wordWrap = true;
var output:String = ""
for(var i:int = 0; i < 50; i ++) {
output += (Math.random() * 100).toString() + "||" + "
";
}
txt.text = output;
addChild(txt);
}
}
}
The textfield is there just because I can’t seem to get trace to work. Anyway, I keep getting identical sets of random numbers. Running the same .swf again and again, I get a few different sets of the SAME numbers . Does this have something to do with the way the random function is seeded? The docs say that the random number is calculated in an “undisclosed manner”. I am stumped. thanks in advance!