What I am trying to do is this: I have a program which makes Javascript SinusPaths. To make the SinusPath there are three values. What I wanted to know how to do was use a random number generator to assign the values everytime someone loaded the page so it would always come up different. Does that make sense? Is that something that Javascript can do?
I know basically how to generate the random number. I just don't know how to get that to be the value of something. Here is the code that I want to put the random numbers into:
And I want to add them to the var distance, the var speedx and the var speedy (which are presently set to 1).
Many thanks in advance to anyone who might be able to help me. Also - I would want each variable to have a DIFFERENT randomly generated number. Does this make a whole lot more complex??
All the best and thanks in advance,
Dick Whyte
I know basically how to generate the random number. I just don't know how to get that to be the value of something. Here is the code that I want to put the random numbers into:
Code:
<script language="JavaScript"> var author="www.dseffects.com"; var image="dot.jpg"; var distance="1"; var speedx="1"; var speedy="1"; var regkey=""; var reglink=""; var regtarget=""; </script> <script src="DS_SinusPath.js"></script>
Many thanks in advance to anyone who might be able to help me. Also - I would want each variable to have a DIFFERENT randomly generated number. Does this make a whole lot more complex??
All the best and thanks in advance,
Dick Whyte
Comment