dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: How would you do this?

  1. #1

    How would you do this?

    I want to randomly select a number, then convert it to an ASCII character, both upper and lower case, numbers and special characters. Any suggestions?
    Thanks in advance.

  2. #2
    Senior Member
    Join Date
    Aug 2001
    Location
    Egypt
    Posts
    332
    Code:
    // pick a number randomly
    ran = Math.floor(Math.random()*200);
    
    // get the ASCII character
    char = String.fromCharCode(ran);
    arrange the number 200 so that the ascii character of the random number generated won't be a number or anything else you don't want..

    Hope this helps.
    Hamza.

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