Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. private function typing(e:TextEvent) {
  2. if(textArea.text.lastIndexOf(" ") == (textArea.text.length - 1)) {
  3. var splitArray:Array = textArea.textField.htmlText.split(" ");
  4. var lastWord:String = splitArray[splitArray.length - 2];
  5. var testVar:int = -1;
  6. for(var c:int=0; c<htmlSyntaxHighlights.length; c++) {
  7. if(htmlSyntaxHighlights[c].search == lastWord) {
  8. testVar = c;
  9. break;
  10. }
  11. }
  12. if(testVar >= 0) {
  13. splitArray[splitArray.length - 2] = htmlSyntaxHighlights[testVar].replace;
  14. textArea.textField.htmlText = splitArray.join(" ");
  15. }
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement