A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [MX] Generating random numbers

  1. #1
    Member
    Join Date
    Jan 2002
    Posts
    46

    [MX] Generating random numbers

    Hi,

    I want to generate random numbers between 1 to 10. I have successfully written script for that. Now, the problem is bcuz it is random it might generate the same number again. I want to eliminate that. I have a vague idea that I will have to store each generated number in an array (using push method) and then every time a number is generated, will have to ask flash if the same exists as an element of the array. If it does, skip and generate again. This way it should generate only 10 numbers, all different, and then stop.

    However, m not able to put this through. Any help would be appreciated.

    Regards.
    Keep on flashing guys

  2. #2

  3. #3
    Member
    Join Date
    Jan 2002
    Posts
    46
    Hi,

    Thanks for the prompt response. I will examine and let you know if any further help is required.

    Regards.
    Keep on flashing guys

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center