Flash: is srand possible?

As the name suggests ... Is srandFlash possible Math.random?

I ask because I would like to generate pseudo random numbers in a repeatable way.

+5
source share
2 answers

Nope. But in the past, I used BitmapData.noise () as a replacement for a poor person. This takes up the seed, and you can use it to populate the dummy bitmap with values ​​from 0..255 (which you can extract and process as ByteArray if you want). Not quite suitable for cryptography, but it will work like a fast hack.

+3
source

In short, no. You will need to complete your own implementation.

+1
source

All Articles