explorers' club

explorations in dev, science, sci-fi, games, and other fun stuff!

Spark Label linebreak

3 Comments

[Note to Self]

You can’t simply set the text of an MXML declared Spark Label like below and expect linebreak or carriage returns to work:

<s:Label text="this is where I desire my line break to be\nnow the second line begins....." 
         maxDisplayedLine="2"/>

You now have to explicitly wrap the linebreak or carriage return in binding brackets and single quotes like so:

<s:Label text="this is where I desire my line break to be{'\n'}now the second line begins....." 
         maxDisplayedLine="2" 
         lineBreak="explicit"/>
Advertisements

3 thoughts on “Spark Label linebreak

  1. Or use “ ” (ampersand + #xd) as in:

    s:Label text=”VIEWS Shows live panels and tools”

  2. Or use “ ” (ampersand + #xd + semicolon) as in:

    s:Label text=”VIEWS Shows live panels and tools”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s