Search Unity

"Input.inputString" don't work in Flash

Discussion in 'Flash' started by pordox, Jan 3, 2012.

  1. pordox

    pordox

    Joined:
    Jul 31, 2010
    Posts:
    16
    Hello everybody

    I'd like to use Input.inputString for my flash contest game, but it doesn't work, no reaction. Any ideas?

    Thank's
     
  2. gonzorob

    gonzorob

    Joined:
    Dec 1, 2011
    Posts:
    96
    same for me - any suggestions?
     
  3. gonzorob

    gonzorob

    Joined:
    Dec 1, 2011
    Posts:
    96
    A hack to fix this. First...

    Code (csharp):
    1.  
    2. private String text;
    3.  
    then on Update() add to this variable with ...
    Code (csharp):
    1.  
    2.  
    3.             if (Input.GetKeyDown(KeyCode.A)){
    4.             text += "a";
    5.             }
    6.             if (Input.GetKeyDown(KeyCode.B)){;
    7.             text += "b";
    8.             }
    9.             if (Input.GetKeyDown(KeyCode.C)){
    10.             text += "c";
    11.             }
    12.  
    etc etc, fill in the remaining characters...

    At the end, I put

    Code (csharp):
    1.  
    2.             // if we press backspace
    3.             if (Input.GetKeyDown(KeyCode.Backspace)){
    4.             if (text.Length != 0){
    5.                     text = text.Substring(0, text.Length - 1);
    6.                 }
    7.             }
    8.             // if we press enter   
    9.             if (Input.GetKeyDown(KeyCode.Return)){
    10.                 // Send that string to the function
    11.                 // FunctionName(text)
    12.                 // blank the text
    13.                 text ="";
    14.             }
    15.  
    Hope this is fixed soon!
     
  4. ArekPoland

    ArekPoland

    Joined:
    May 25, 2012
    Posts:
    16
    What about signs like "@" or "."?
    To me it doesn't work for this two. And you?