Convert new lines to single line space when read from external file

This is a handy code that I use very often in actionscript 1 and 2 to convert new lines to one new line as it is visible in html. Flash thinks them as double new lines \n\n instead of \r\n (return and new line). This code removes \n (new line) and leaves \r (return) in string.


function textToFlashTF(text) {
return text.split('\r\n').join('\r');
}

Bookmark and Share
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • email
  • StumbleUpon
  • TwitThis

Related posts:

  1. Cool text codign effect for flash menus There are plenty of web sites using some kind of...

Leave a Reply

© 2005-2010 veppa.com | Sitemap