Posted By

shalomfriss on 10/13/10


Tagged

textmate actionscript 3 Flex as3


Versions (?)

Flex Multiline Label


 / Published in: Other
 

  1. package components
  2. {
  3. import mx.core.UITextField;
  4. import flash.text.TextFieldAutoSize;
  5. import mx.controls.Label;
  6. import flash.display.DisplayObject;
  7.  
  8. public class MultiLineLabel extends Label
  9. {
  10.  
  11. override protected function createChildren() : void
  12. {
  13. // Create a UITextField to display the label.
  14. if (!textField)
  15. {
  16. textField = new UITextField();
  17. textField.styleName = this;
  18. addChild(DisplayObject(textField));
  19. }
  20. super.createChildren();
  21. textField.multiline = true;
  22. textField.wordWrap = true;
  23. textField.autoSize = TextFieldAutoSize.LEFT;
  24. }
  25. }
  26. }
  27.  

Report this snippet  

You need to login to post a comment.