A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] txt swr

  1. #1
    purple lizard
    Join Date
    Jan 2007
    Location
    somewhere in the world
    Posts
    85

    [F8] txt swr

    Right. There is this software I got called Th Ft--Mr, which lets you write lk ths. I would like to make something similar. There is an input text box with an itstance name "input" and an output text box (instance name, output, which displays the rr hrtrs when you type something in to the input box. But I could do with some help. I need a code that will make the output box display a differant character to the one that you type into the input box. Please?

  2. #2
    Senior Member
    Join Date
    Apr 2006
    Posts
    1,059
    you would set up an OnChange listener for the input box and onchange you would do something like
    Code:
    var newString = ""
    for(var i = 0 ; i <  inputText.text.length;i++){
         switch(inputText.text.charAt(i)){
              case 'a' : newString += ":A:"  //or whatever
                           break; //escape from switch statement
              case 'b' : newString +=":B:"
                           break;
               ....//repeate for all leters both cases (a-z/A-Z/0-9 ..and any other chars you wnat)
             default : newString+=inputText.text.charAt(i) // if it doesnt match any of our cases.. then just add whatever char is there
                            break;
    
    
    
         }
    
    }
    outPutText.text = newString

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