User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16

Thread: Edit Box: Ignore capitalization and punctuation?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jan 2010
    Posts
    545
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Edit Box: Ignore capitalization and punctuation?

    Hi,
    I am making a game that requires that players type in a correct answer into an edit box. Unfortunately, correct answers are marked wrong if they are not entirely in the right case (uppercase or lowercase) or if they have an extra space at the end of the last word etc. Is there a way to make the game ignore capitalization and punctuation for answers typed into an edit box? Thanks,
    Brett

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    The edit box object has a property that will force everything to be uppercase or lowercase. I think you can also just convert everything to uppercase in the expression editor, though I'm not sure about that. As for ignoring punctuation, I don't know how easy that would be, and I don't know any ways to do it off of the top of my head.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jan 2010
    Posts
    545
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi happygreenfrog,
    I already have the property set to force everything to be lowercase, but in the iOS version of the game it automatically capitalizes the first letter, even though this property is set. I am wondering if this property does not work in iOS? Also, are there any ideas on ignoring spaces and punctuation? Thanks,

    Brett

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Ignoring spaces is a bad idea, since then typing like this:
    HIIMHAPPYGREENFROGWHOAREYOUILIKETYPINGTHISISVERYCO NFUSINGANDSTRANGETYPETYPETYPETYPETYPETYPETYPETYPEI SNTITCONFUSINGRIGHTRIGHTRIGHT

    And still get it right. Instead, you should program it to detect double/triple spaces, and remove them. I don't exactly have access to MMF2 right now, so I can't really make an example on how to do that (and, even if I did, I haven't done such a thing before).

  5. #5
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleInstall Creator Pro

    Join Date
    Dec 2010
    Location
    United Kingdom
    Posts
    961
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by brett
    Also, are there any ideas on ignoring spaces and punctuation?
    Hello, I have a suggestion for clearing any excess spaces or punctuation at the end when the user hits the button to continue. You can add a bit extra by comparing two general values to check for a specific character from the text box at the end. It's built-in to the expression editor, the Right$ button can filter the character out, here's how it works:

    Condition: When button clicked.
    --> Compare two general values (under Special conditions)
    Right$(Edittext$( "Edit Box" ), 1) = " "

    Right$ meaning the right part of the string. 1 being the last character. " " being the space.
    So in this case: "Hello" is o. "Computer_" is the space.

    Action: Set text box "Edit Box"
    Left$( Edittext$( "Edit Box" ), Len( Edittext$( "Edit Box" )-1 ) )
    This would set the same text box but without the last character if it meets the condition. The length of the string minus the last character (being the space)

    Of course, if you want to check for punctuation at the end, you'll need to repeat this process, but with "!" "." "," and such, but this does work, and should have no problems with iOS.

    Possibly, if it's available for iOS, it's even easier to use an extension called Regular Expressions Object, which can input the string, check for "!" and replace with "" (nothing)

    I hope this answers your question

    Quote Originally Posted by brett
    I already have the property set to force everything to be lowercase
    For this, all I can suggest is having a second hidden textbox and when the user is finished typing, a copy of what the user has typed will be set in the hidden textbox (with the lowercase option set) ... It might work or it might end up with the same result.

  6. #6
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    If needed, I have an extension that removes leading and trailing spaces from an a word.

    Meaning if you wanted to have "Hello Good Sire" as the correct answer, and the user types " Hello Good Sire ", the answer would be correct. The changed expression would equal "Hello Good Sire" This same extension can also ignore punctuation marks, numbers, vowels, consonants, etc within a phrase.

  7. #7
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,825
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)
    that sounds like a cool extension ProdigyX

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jan 2010
    Posts
    545
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi ProdigyX,
    That sounds great. Also, does it work with all runtimes? (iOS, Flash, and Android) Where can I get it? Thanks,
    Brett

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jan 2010
    Posts
    545
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi lh37,
    I am trying your method, but I'm unable to get the action to work. I get an error message in the expression editor that says "mixed numbers and strings." Do you experience this? Am I missing something? Thanks,
    brett

  10. #10
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Dear Brett,

    At the moment, this extension is windows only. If you need it in a different runtime, I'll do my best get it ported to said runtime. Is there one you have in mind specifically?

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Using String Parser to check for any punctuation in a string
    By Apex in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 18th May 2012, 11:03 PM
  2. Linked to. Everyone please ignore.
    By legocacher in forum File Archive
    Replies: 4
    Last Post: 6th August 2010, 09:01 PM

Posting Permissions

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