I use it all the time.
random(2) = Math.round(Math.random());
gimme a break.
I use it all the time.
random(2) = Math.round(Math.random());
gimme a break.
I dunno why it was deprecated, but:
random(2) is not the same as Math.round(Math.random()*2);
random(2) return an integer between 0 and 2, not including 2;
Math.round(Math.random()*2) return an integer between 0 and 2 (included).
*Originally posted by claudio *
**I dunno why it was deprecated, but:
random(2) is not the same as Math.round(Math.random()*2);
random(2) return an integer between 0 and 2, not including 2;
Math.round(Math.random()*2) return an integer between 0 and 2 (included). **
Hehe, I beat you to it (the fix) thanks though.
:beam:
Hoi
i guess Macromedia whated to do it all in a more OO way :sure:
oh this should be better
random(2) = Math.**floor**(Math.random()*2);
:thumb:
I don’t really know why, but i assume it has something to do with the fact that after flash 4, ActionScript followed the ECMA standards … the old random() is faster than Math.random() though :-\
*Originally posted by ahmed *
**I don’t really know why, but i assume it has something to do with the fact that after flash 4, ActionScript followed the ECMA standards… the old random() is faster than Math.random() though :-\ **
ding ding!
I remember someone saying that Math.random() is more random than random() but I see no difference! :-\
someone here did a really good thing on how random is random, plugging in the values in excel and making a chart and everything - that was pretty wild, but I dont think they compared random to Math.random. I think it was just random. … so I dont know if one is more random than the other or not :-\
… I think I might have heard the same though
Maybe their just the same…
just that random is global and Math.random isn’t!!
:-\
[SIZE=1]just an idea [/SIZE]
*Originally posted by Master64 *
**Maybe their just the same…
just that random is global and Math.random isn’t!!
:-\
[SIZE=1]just an idea [/SIZE] **
i guess it just goes back to having everything more object oriented like you said before.
*Originally posted by senocular *
**someone here did a really good thing on how random is random, plugging in the values in excel and making a chart and everything - that was pretty wild, but I dont think they compared random to Math.random. I think it was just random. … so I dont know if one is more random than the other or not :-\
… I think I might have heard the same though **
why dont you post it again, i’d like to see it
*Originally posted by norie *
**why dont you post it again, i’d like to see it **
My previous post was a link, I know sometimes it’s hard to tell.
gotcha…
nice!
very nice jingman! =)
lol @ phil
:: Copyright KIRUPA 2024 //--