-
Multi-coloured text in dynamic text field
Hi
I need to create a text field with Actionscript that is comprised of text in 2 colours. Is this possible (maybe with textformat)?
Thanks in advance
g
If it ain't broke, don't fix it.
-
I'd really like to know if this is possible or not.
Thanks
If it ain't broke, don't fix it.
-
FK'n_dog
is this what you seek ?
Code:
this.createTextField("mytext", 10, 300, 200, 10, 10);
mytext.autoSize = true;
mytext.html = true;
mytext.htmlText = "Hello Mum :)<br>"+
"<p align='center'>Hello<br>World";
mytext.textColor = 0x00FF00;
format = new TextFormat();
format.color = 0xFF0000;
format.size = 25;
mytext.setTextFormat(6,18,format);
-
Thanks modified dog - this looks promising. I take it I can use this with an embedded font too?
Cheers
If it ain't broke, don't fix it.
-
FK'n_dog
Sure can.
Link your font in the Library and use its identifier name
mytext.embedFonts = true;
format.font = "web"; // Linkage name of font
-
that's great.
Thanks again
If it ain't broke, don't fix it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|