How to rotate a label or text in Flex
Problem: when setting the rotation property on a Flex label or text component the component becomes invisible.
Cause: To rotate text in Flex the font must be embedded.
Easy Solution:
1. Embed a system font in your Application like so:
[Embed(systemFont='Verdana', fontName='myPlainFont', mimeType='application/x-font' )]
private var font1:Class;
2. set the embedded font as font family for the text component you want to rotate, e.g:
l = new Label() ;
l.setStyle("fontFamily" ,"myPlainFont") ;
3. set rotation ( e.g. l.rotation = 90 ) - now the label should be rotated by 90 Degrees and visible.
Reference: http://livedocs.adobe.com/flex/3/html/help.html?content=fonts_04.html
Comments
Leave a comment Trackback