tags:

views:

62

answers:

2

Like the title suggests… Is it possible to srand Flash's Math.random?

I'm asking because I'd like to generate psudo-random numbers in a repeatable way.

+1  A: 

In short, no. You'd need to roll an implementation of your own.

zeh
+2  A: 

Nope. But in the past I have used BitmapData.noise() as a poor man's substitute. That takes a seed, and you can use it to fill a dummy bitmap with values from 0..255 (which can be extracted and treated as a ByteArray if you like). Not exactly suitable for cryptography, but it will work as a quick hack.

fenomas
+1; it's a nice solution.
zeh