Sunday 28 November 2010

Multi-Line Flex Label [MXML]

Just stumbled across this one while writing some mxml for a personal project and thought I would share.

Have you ever wanted to have multi-line text in your label component in spark and thought the following should work?

[codesyntax lang="mxml"]
<s:Label text="I like text on the \n next line" />

[/codesyntax]

But all it produces is:



Yep me too.

After some playing however I stumbled accross the following solution:

[codesyntax lang="mxml"]
<s:Label text="I like text on the {'\n'} next line" />

[/codesyntax]

It then produces the expected result:



Im just guessing but I suspect its something to do with the black art of the flex life cycle. By adding the {'\n'} we are turning the property initialisation on the label component from a simple literal assignment into a delayed binding assignment and therefore gets parsed differently.

Just a guess, let me know if im way off.

Monday 22 November 2010

Day[9] - A Moving Story of a Pro-Gamer [Video]

Day[9] is a Starcraft2 commentator and a professional gamer (among other things). I have been following him for sometime watching his 'casts' of games. He just posted this video on Youtube (although its an old episode), its an incredibly moving tale of his journey through gaming to becoming one of the top players in the world. More than that he relates it to how his family have supported him through his passion and giving him belief to do what he loves.

If you enjoy gaming or know someone that enjoys gaming I cant encourage you enough to watch this video. Its quite long but I strongly encourage you stick with it till the end!



If you liked Day[9]'s quirky style of humor of  or are interested in watching some more of his casts you should checkout either his Youtube channel or his BlipTV archive.