PDA

View Full Version : TextArea styles


maroof_d
10-14-2003, 12:08 PM
if iwant to change color of TextArea text,
i write

textArea.setStyle("color","red");

when i want to change the color again, i write ,

textArea.setStyle("color","black");

it does'nt work!!
even the fonts cant be changed.
can any1 help me out.
Thanx.

Mortimer Jazz
10-14-2003, 01:41 PM
What event are you using to trigger the change?
This worked fine for me:

//text area with instance name of myTA placed on the stage
myTA.setStyle("color", "0xFF0000"); //can also use "red"

//button with instance name of myButton placed on the stage
myButton.onRelease = function(){
myTA.setStyle("color", "0x0000FF");//can also use black
}

maroof_d
10-15-2003, 03:21 AM
i'm making the changes in a class since the TextArea is a part of a component.
the function is:

function ChangeStyle(prop:String,param:String){

textArea.setStyle(prop,param);

}

//***********
in my fla file, i place an instance of the Component on stage, say, myComp.

on the click of button1, i have written,
myComp.ChangeStyle("color","red"); //Works
And
on the click of button2, i have written,
myComp.ChangeStyle("color","black"); //Does'nt Work

button1 and button2 are Button instances.
Can u gimme a solution? :)
Thanx for replying

maroof_d
10-15-2003, 03:40 AM
My mistake, i was misspelling the component instance name.
Thanx :-D

This site is Heaven for me. it's the only resource for AS2.0 code snippets n stuff :)
Cheers,