To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 09-11-2006, 09:14 AM   #1
geedubb
Grandmaster Flash
 
Join Date: Apr 2004
Location: Edinburgh, Scotland
Posts: 139
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.
geedubb is offline   Reply With Quote
Old 09-12-2006, 04:26 AM   #2
geedubb
Grandmaster Flash
 
Join Date: Apr 2004
Location: Edinburgh, Scotland
Posts: 139
I'd really like to know if this is possible or not.

Thanks
__________________
If it ain't broke, don't fix it.
geedubb is offline   Reply With Quote
Old 09-12-2006, 04:29 AM   #3
a_modified_dog
FK'n_dog
 
a_modified_dog's Avatar
 
Join Date: Apr 2003
Location: "aaarf"
Posts: 9,176
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);
a_modified_dog is offline   Reply With Quote
Old 09-12-2006, 04:32 AM   #4
geedubb
Grandmaster Flash
 
Join Date: Apr 2004
Location: Edinburgh, Scotland
Posts: 139
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.
geedubb is offline   Reply With Quote
Old 09-12-2006, 04:45 AM   #5
a_modified_dog
FK'n_dog
 
a_modified_dog's Avatar
 
Join Date: Apr 2003
Location: "aaarf"
Posts: 9,176
Sure can.
Link your font in the Library and use its identifier name

mytext.embedFonts = true;

format.font = "web"; // Linkage name of font
a_modified_dog is offline   Reply With Quote
Old 09-12-2006, 04:47 AM   #6
geedubb
Grandmaster Flash
 
Join Date: Apr 2004
Location: Edinburgh, Scotland
Posts: 139
that's great.

Thanks again
__________________
If it ain't broke, don't fix it.
geedubb is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:39 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.