The solution that was enough for my needs is even simpler, create an instance variable containing a random number. This is most likely (but not guaranteed) to be different for each object, depending on how much you have.
private var _id:int = Math.random() * 10000000;
source
share