PDA

View Full Version : setStyle not working with new TextArea


djoseph74
08-05-2009, 06:30 PM
Hi Everyone,

I have:


vb.label = "woof" + counter;

chatTA.x = 10;
chatTA.y = 10;
chatTA.width = 390;
chatTA.height = 460;
chatTA.id = "woof" + counter;
chatTA.wordWrap = true;
chatTA.editable = false;

chatTA.setStyle( "chatMsgsTextArea", 12 );

vb.addChild( chatTA );

tabNavigator.addChild( vb );


I am creating a new tab on a TabNavigator. That portion is working fine. Its creating the tab, creating the textarea, but the styling is not there. I have my style setup:


<mx:Style>
.chatMsgsTextArea
{
borderColor: #000000;
borderStyle: solid;
color: #000000;
cornerRadius: 7;
fontSize: 12;
}
</mx:Style>


the only thing its not doing is styling the new TextArea.

I'm guessing maybe I'm doing it in the wrong place or something, but can't put my finger on it.

Can someone assist?

-djoseph74

shubs6
08-06-2009, 05:48 AM
Joseph, use setstyle() like this.



chatTA.setStyle( "styleName", "chatMsgsTextArea" );



Alternatively, you can doi like this



<mx:textarea stylename="chatMsgsTextArea" />

djoseph74
08-06-2009, 02:19 PM
Perfect, worked like a charm. Thanks for the help!

shubs6
08-07-2009, 04:24 AM
You are welcome buddy!