One field two words


Hi guys

wondered if i have one text field with two words, one needs to be bold and one regular.
Is there an AS3 code which can achieve it ?



Yes, the setTextFormat method of TextField allows you supply the beginning and ending index of the text you want to change the format of.


Thanks TheCanadian

This is the script i used, Two text elements, one background which grows/shrinks according to both text fields and one mask for the business:

field1.harmonicTextField.text = “First”;
field1.harmonicTextField.width = field1.harmonicTextField.textWidth+10
field2.harmonicTextField.text = “Second”;
field2.harmonicTextField.width = field2.harmonicTextField.textWidth+10
field2.x = field1.x+field1.width+10;
//box_mc1.width = field1.harmonicTextField.width+field2.harmonicTextField.width+100;
BG1.x = field1.harmonicTextField.textWidth+field2.harmonicTextField.textWidth-1360;
mask1.x = field1.harmonicTextField.textWidth+field2.harmonicTextField.textWidth-1360;

Thanks again