A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: any number

  1. #1
    SeniorMember yet almost newbie deniel87's Avatar
    Join Date
    Oct 2001
    Posts
    202

    any number

    is there a way of seting a variable to be any number?
    for example
    n= real numbers
    or
    n=infinite
    or
    n= any number between 0 and 999
    Thanks for helping

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    n = random(999);
    or
    n = Math.random()*999;

  3. #3
    SeniorMember yet almost newbie deniel87's Avatar
    Join Date
    Oct 2001
    Posts
    202

    mmm no

    what I want is to be all the numbers, not just one of them... I want to make it so that is I ask if N is equal to 9, the answer is true and if I ask if N is equal to 4, the answer is true again
    And so on with every number between 0 and 999
    Thanks for helping

  4. #4
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    if N==9, then N!=4
    May be you ask about Number(N)?
    Number(N) is always a number.

  5. #5
    SeniorMember yet almost newbie deniel87's Avatar
    Join Date
    Oct 2001
    Posts
    202

    here

    what I mean is that 8,9,2,4 they are all numbers
    If N="any number" then N=4 and also N=2 and N=6
    Is this possible?
    Thanks for helping

  6. #6
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    Do you yourself understand your own question?
    Why should N = 2 or 6, if N is alredy == 4?
    If you want to know whether some variable is a number, you can
    use function isNaN(variable). If it's a number, isNaN returns false,
    if it's not a number then isNaN returns true.

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