A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: simple password problem

  1. #1
    Junior Member
    Join Date
    Mar 2000
    Posts
    3

    Post

    hi,

    i am trying to create a member code input.
    some of the code should be letters, some numbers. i have managed to detect and test the letter inputs (using the Ord function). i need help to detect if the others are numbers.

    can anyone please help before i tear out all of my hair?


    ------------------
    cheers,
    Rich.

  2. #2
    Senior Member
    Join Date
    Mar 2000
    Posts
    597

    Post

    My last mesage didn't display properly (it missed some action script - I tried to edit it but it looked OK?? Any problems here?

    So I'm reposting

    Here is one way.

    The following if condition will be true when variable “input” contains a number and false for any other character

    If (ord(input)>=ord("0") and ord(input)<=ord("9"))

    The following will be false when variable "input" contains a number and true for any other character

    If (ord(input)<ord("0") or (ord(input)>ord("9"))

    There is an example in Flash’s help of the condition above - but Macromedia’s coding is more complex than required

    Hope this helps,

    Rich.

    [This message has been edited by rich (edited 01 April 2000).]

  3. #3
    Senior Member
    Join Date
    Mar 2000
    Posts
    597

    Unhappy

    For some reason the last if statement won't post correctly

    Hopefully this works.

    It should read :

    If (ord(input)<ord("0") or (ord(input)>"9")

    Mr Moderator,

    Is there a problem somewhere. I've edited the message above this one and it looks OK in the edit message screen but the post doesn't contain the correct code.

    Any suggestions?

    Thanks,

    Rich.

  4. #4
    Senior Member
    Join Date
    Mar 2000
    Posts
    597

    Post

    Grrr...

    even the above didn't post correctly and I retyped the offending line.


  5. #5
    Junior Member
    Join Date
    Mar 2000
    Posts
    3

    Post

    cheers rich

    If (ord(input)&gt;=ord("0") and ord(input)&lt;=ord("9")) ....works fine.

    you have no idea how relieved i am!!!!!
    thanks.

    ------------------
    cheers,
    Dodge.

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