nsurendiran
09-26-2008, 10:28 AM
Hi All,
Kindly see below the code attached. If I choose the Comic Sans MS as the fontFamily in the label, the output was fine. But If I choose "Times New Roman" or "Arial" or "Courier New" as the fontFamily, I am getting lots of blankspace after the second line "HELLO HOW ARE YOU".
But my requirement was at any point of time, the space above the first line and the space after the second line should be the same.
Any help would be appreciated.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
public function calltext():String{
var labeldata:Array = new Array();
labeldata.push("HAI");
labeldata.push("HELLO HOW ARE YOU?");
var lasttext:String = labeldata.join("\n");
return lasttext;
}
]]>
</mx:Script>
<mx:VBox horizontalScrollPolicy="off" verticalScrollPolicy="off">
<mx:Label text="{calltext()}" height="75" fontSize="25" fontFamily="Comic Sans MS" opaqueBackground="gray" color="red" width="500"/>
</mx:VBox>
</mx:Application>
Thanks.
Kindly see below the code attached. If I choose the Comic Sans MS as the fontFamily in the label, the output was fine. But If I choose "Times New Roman" or "Arial" or "Courier New" as the fontFamily, I am getting lots of blankspace after the second line "HELLO HOW ARE YOU".
But my requirement was at any point of time, the space above the first line and the space after the second line should be the same.
Any help would be appreciated.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
public function calltext():String{
var labeldata:Array = new Array();
labeldata.push("HAI");
labeldata.push("HELLO HOW ARE YOU?");
var lasttext:String = labeldata.join("\n");
return lasttext;
}
]]>
</mx:Script>
<mx:VBox horizontalScrollPolicy="off" verticalScrollPolicy="off">
<mx:Label text="{calltext()}" height="75" fontSize="25" fontFamily="Comic Sans MS" opaqueBackground="gray" color="red" width="500"/>
</mx:VBox>
</mx:Application>
Thanks.