PDA

View Full Version : whats happened to random?


vanGog
09-24-2007, 10:08 PM
hi,

more and more i'm figuring out, that AS3 is much more complicated than AS2... in many things that are simple in AS2.

first problems i had here:
http://www.actionscript.org/forums/showthread.php3?t=148187

and now i just found out that the good old random-function with a parameter istn working any more...
random(value:Number) : Number

in AS3 there is only the normal random function available as far as i can see, isnt it?
random() : Number

why do i have to create annoying roundabouts for such simple functions?

or am i just failing to notice some facts, because im new to ActionScript?

greetings
vanGog

stompwampa
09-24-2007, 10:28 PM
Math.random();

vanGog
09-24-2007, 11:40 PM
Math.random() and random() is for me the same.
you cant use a parameter either...

Glen Charles Rowell
09-25-2007, 04:51 AM
What do you wanna do with random()? Maybe we can help you if you give us an example.

Glen Charles Rowell

atomic
09-25-2007, 05:03 AM
If only for reading...

http://board.flashkit.com/board/showpost.php?p=2859332&postcount=2

vanGog
09-25-2007, 11:52 AM
thank you for that link to the post, atomic ;)

nethertheless it is annoying.

@ Glen Charles:

i just want back the useful random(n) function. because now you have to write Math.floor(Math.random()*n) for this... :mad:

greetings

CyanBlue
09-25-2007, 12:34 PM
Make your own function out of that and be done with it... There is no point of arguing with what's already done... It only makes sense if we are the ones who did that, but we are not... Don't you think??? ;)

stompwampa
09-25-2007, 02:01 PM
i just want back the useful random(n) function. because now you have to write Math.floor(Math.random()*n) for this... :mad:

greetings


Sounds to me like a great opportunity to make a new class for future use....you could even call it the random class if you'd like to reminisce of days old :rolleyes:

Glen Charles Rowell
09-27-2007, 09:33 AM
I don't wanna learn how to make classes but I can help with the random bit. I know Flash code is now a lot longer and more annoying in many ways but that is just something we will have to live with. I just don't get why companies give you an error code for something but don't show you ways to fix it in stead of giving you an error code.

Where is the auto error fix button in Flash?

Glen Charles Rowell