Reply LinkBack Thread Tools Search this Thread
Old 25-08-2005, 03:55   #1 (permalink)
paulanthony
mingin dawg baitch
 
paulanthony's Avatar
 
Join Date: Apr 2004
Location: Belfast
Posts: 1,035
Send a message via MSN to paulanthony
Flash change color of textfield

_root.texttitle = _global.selectedTitle;
_root.texttitle.setStyleProperty("textColor", "0xFFFFFF");
FStyleFormat.applyChanges;

anyone know why this no worky? its on the root timeline..
__________________
  Reply With Quote
Old 25-08-2005, 04:42   #2 (permalink)
dan
Iris Folder
 
dan's Avatar
 
Join Date: Apr 2003
Location: smokey
Posts: 2,643
Code:
_root.texttitle.setStyleProperty("textColor", "0xFFFFFF");

So is this a text field or are you using components? if it's a text field...

Code:
_root.texttitle.textColor = 0xFF0000;
?
  Reply With Quote
Old 25-08-2005, 04:52   #3 (permalink)
paulanthony
mingin dawg baitch
 
paulanthony's Avatar
 
Join Date: Apr 2004
Location: Belfast
Posts: 1,035
Send a message via MSN to paulanthony
Im not...I pulled that code from some other place..like a plonker...standard dynamic textfield...

._root.texttitle.textColor = "0x000000";

doesn't want to play ball either
__________________
  Reply With Quote
Old 25-08-2005, 04:53   #4 (permalink)
paulanthony
mingin dawg baitch
 
paulanthony's Avatar
 
Join Date: Apr 2004
Location: Belfast
Posts: 1,035
Send a message via MSN to paulanthony
either with or without the quotes...Ive tried all sorts of combinations....


Found the problem...I can apply the text via the Var: texttitle but the instance needs to be named as well to get it working in code..so I named it texttitle also - but that didn't work cause code didn't know what it was talking to...so I called it summit different - and it worked.

_root.texttitle = _global.selectedTitle;
_root.texttitleins.textColor = 0x000000;
__________________

Last edited by paulanthony : 25-08-2005 at 04:58. Reason: Found problem
  Reply With Quote
Old 25-08-2005, 05:14   #5 (permalink)
dan
Iris Folder
 
dan's Avatar
 
Join Date: Apr 2003
Location: smokey
Posts: 2,643
You didn't name your instance... alway's name your instances whether your gonna use them or not, makes things easier in the long run.

Naming it the same as the var shouldn't have caused issues.

It's good practice to name your instances with extensions so that you always know what kind of object your dealing with title_txt , title_mc, title_gr etc.

For future reference you can also add text to a text field using the .text method. Good for appending text to a field

_root.title_txt.text = "hello";
_root.title_txt.text += " how are you doing?";
  Reply With Quote
Old 26-09-2005, 02:00   #6 (permalink)
meatcake
Registered User
 
Join Date: Sep 2005
Posts: 4
yo,

//////simplest way to change color/////
var TF:TextFormat = new TextFormat();
TF.color = 0x990000; //red
myTextField.setNewTextFormat(TF);
// your text is red now
//is fish blood red?
//it's not. tuna blood is red.
//i want marijuana.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8