all groups > flash actionscript > january 2005 >
You're in the

flash actionscript

group:

Dynamic text fields


Dynamic text fields Lilibeta
1/9/2005 11:15:13 PM
flash actionscript:
I've created a multi line dynamic field with a right hand scroll bar. This
field is to basically present biographies for several characters. I want the
titles ie Name, Race, Age, Bio etc to be in one colour and the corresponding
data to be another. I obtained code from this board which I customized to my
progject and it is as follows:
bioTB = bioText_0
style1 = new TextFormat();
style1.size = 13
style1.color = 0xcc0000;
style2 = new TextFormat();
style2.size = 12;
style2.color = 0x00ff00;
bioTB.setTextFormat(0,bioTB.text.indexOf(':')+1,style1);
bioTB.setTextFormat(bioTB.text.indexOf(':')+1,bioTB.text.length,style2);

The code only seems to work for the first line. IOW Name is red, the actually
name is green which is what I want, but the remaining text in the field is also
green.

Help?
Lilibeta
Re: Dynamic text fields NSurveyor
1/9/2005 11:53:59 PM
AddThis Social Bookmark Button