The Dev Pages

A knowledge base for simple (and beyond) web applications development

Line break in Flex or Actionscript 3 text


Posted on June - 12 - 2008



Displaying a newline in a UI component in flex was a bit tricky.

The following would not work:

somevar:String = “Here is line 1 text \n followed by line 2 text”;

 

The following worked in my situation.

somevar:String = ‘Here is line 1 text’ + ‘\n’ + ‘followed by line 2 text’;

If all else fails you can use a more explicit directive, i.e. use {‘\n’} intead of \n

http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=9223

  1. juniper Said,

    Nice Site!
    http://google.com

Add A Comment