5

With the Flex 3 SDK you simply needed to set the borderThickness style to 0, or set borderStyle to none. With the Flex 4 SDK ad the Spark theme, this has no effect.

Kyle Hale
  • 7,912
  • 1
  • 37
  • 58
Joel Hooks
  • 6,465
  • 4
  • 33
  • 39

7 Answers7

9

Try something like:

borderVisible="false"
Mark Ursino
  • 31,209
  • 11
  • 51
  • 83
bz.
  • 99
  • 1
  • 2
2

If you want to remove the border from spark TextArea's here are some ways to do so: To make all spark TextAreas have no border you can do this:

s|TextArea {
  borderVisible : false;
}

You can also make a simple style and only apply them to specific spark TextAreas like so:

.noBorder {
  borderVisible : false;
}
...
<s:TextArea styleName="noBorder"/>

You can turn it off via creation complete like so:

<s:Application ...
  creationComplete="onCreationComplete()"/>
...
private function onCreationComplete() : void {
  mySparkTextArea.setStyle('borderVisible', false);
}
...
<s:TextArea id="mySparkTextArea"/>
</s:Application>

Finally, you can make a skin, per DrMaxmAd's suggestion, like so:

...
<!-- border/fill --> 
<s:Rect left="0" right="0" top="0" bottom="0">
    <s:stroke>
        <s:SolidColorStroke color="#5C5C5C" weight="1" alpha="0"/>            
    </s:stroke>
    <s:fill>
        <s:SolidColor color="#FFFFFF"/>
    </s:fill>
</s:Rect>
...
nephiw
  • 1,964
  • 18
  • 38
1

I haven't dabbled in Flash Builder 4 yet, but I know in Flex 3 you can modify things like this (when its not possible another way):

var tb:TextInput = new TextInput();
tb.getChildAt(0).setStyle(...);

Might want to give this a try, you just need to find the correct child element usually.

EDIT: Here's your answer

Lucas Jones
  • 19,767
  • 8
  • 75
  • 88
Chris Klepeis
  • 9,783
  • 16
  • 83
  • 149
1

You have to set the borderSkin to null

<mx:TextArea borderSkin={null} />
Joel Hooks
  • 6,465
  • 4
  • 33
  • 39
0

In Flex 3: The border for TextArea component can be controlled by using these two attributes/properties:

  • borderSkin="{null}"
  • focusAlpha="0"

Focus alpha ensures that you don't get the border showing up even when the TextArea is selected.

Abhijeet
  • 8,561
  • 5
  • 70
  • 76
0

Jeol your answer works for MX components, for the flex 4 spark textarea component you set borderVisible="false" and in code lblMessage.setStyle("contentBackgroundAlpha", 0);

Also, if your doing this, you probably want the hack to make the damn thing autosize to it's content... set heightInLines="{NaN}"

<s:TextArea borderVisible="false" focusEnabled="false" width="100%" id="lblMessage" heightInLines="{NaN}"  editable="false" selectable="true" lineBreak="toFit" verticalScrollPolicy="off" horizontalScrollPolicy="off" />

protected function OnCreationComplete(objEvent:Event):void{
   lblMessage.setStyle("contentBackgroundAlpha", 0);
 }

...and Thanks for RobotLegs, it's freaking awesome!

JTtheGeek
  • 1,707
  • 14
  • 17
0

well i have tried the above code but it does not work for me Flex Hero SDK 4.5, so what i did i selected the textArea and created a new custom skin and change the border alpha to 0.

<!-- border/fill --> 
    <s:Rect left="0" right="0" top="0" bottom="0">
        <s:stroke>
            <s:SolidColorStroke color="#5C5C5C" weight="1" alpha="0"/>            
        </s:stroke>
        <s:fill>
            <s:SolidColor color="#FFFFFF"/>
        </s:fill>
    </s:Rect>

simple and sweet

DrMaXmAd
  • 9
  • 1