используй:

Код:
m1 = Math.floor (Math.random ()*10);
m2 = Math.floor (Math.random ()*10);
m3 = Math.floor (Math.random ()*10);
m4 = Math.floor (Math.random ()*10);
if (m2 == m1) {
m2 = Math.floor (Math.random ()*10);
} else if (m3 == m2) {
m3 = Math.floor (Math.random ()*10);
} else if (m4 == m3) {
m4 = Math.floor (Math.random ()*10);
}
trace (m1+', '+m2+', '+m3+', '+m4);