Wednesday, August 24, 2011

Flex: Measuring width of text of a Label

I have encounter a few situations in Flex where you need to position 2 labels side by side and the one on the left always ended up to be a dynamic label. If this is Flash, you can always use a .textWidth / .textHeight to solve the problem but in Flex, some of these properties were not available hence here's a workaround for it.



	
	
		Label{
			font-Size:20;
		}
	
	
		
	
	
	
		
		
			
		
		
			
		
		
			
		
		
			
		
		
		
			
			
		
	


Click here to view the demo.
Click here to download the source file of the demo.

No comments:

Post a Comment