Welcome Guest [Log In] [Register]
Welcome to Brackenwood. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
textfield question
Topic Started: Jan 13 2006, 10:13 PM (186 Views)
Krob
Brackenwood Lightweight
quick, stupid, little question.. :P is it possible when you have a textfield, to underline or give a certain piece in it a different color? and maybe add a rollover to that specific piece..
Offline Profile Quote Post Goto Top
 
Mr. Jiggmin
Member Avatar
made of tulips
You can do just like you would with html.

http://www.scriptsearch.com/cgi-bin/jump.cgi?ID=1674
Offline Profile Quote Post Goto Top
 
Krob
Brackenwood Lightweight
i guess its not possible to add an action (onRelease or something) to words in the Textfield then?

thanks for this solution though :P its also very handy B)
Offline Profile Quote Post Goto Top
 
smoscar_01
Member Avatar
Mid-Level ActionScripter
quick, stupid, little answer.. :P

Create two Dynamic textfields one with the name "TextBox" and the other with the name "TextBox_changed" and paste this code into the first frame

Code:
 
var myword:String = "my word";
var long:Number = myword.length;
var myarray = new Array();
var i,n:Number = 0;
var space:Number = 0;

TextBox.text=myword;
for (i=0; i<long; i++)
myarray[i]=myword.charAt(i);
do{
TextBox_changed.text=TextBox_changed.text+myarray[n];
n++;
}while (myarray[n]!=" ");
TextBox_changed.textColor = 102;

//In space you can put the amount of space depending on the font
//and on the lenght of the word
TextBox_changed._x = TextBox._x+space;
TextBox_changed._y = TextBox._y;


Note: In order to add a rollover to just an specific part of the text you need a new Textfield so in this example you could add the onRollOver action to TextBox_changed.

In this case you are changing the first word's color and thats why space=0 :)
Offline Profile Quote Post Goto Top
 
Krob
Brackenwood Lightweight
*edit*
ah like that..:P

thanks :D
Offline Profile Quote Post Goto Top
 
smoscar_01
Member Avatar
Mid-Level ActionScripter
you are welcome feel free to post any other doubt :)
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Actionscript · Next Topic »
Add Reply