2 Replies Latest reply on Sep 21, 2010 11:18 AM by Scaljeri

    remove mx:TextInput borders (focus)

    Scaljeri Level 1

      Hi All

       

      I have this TextInput element which I want to use without its borders. I can remove the borders, but when I click in the textfield it gets orange borders.

       

      So the questions is how do I remove these borders when the TextInput element has the focus ?

       

      Here is the code I currently have:

       

       

      <mx:TextInput text="My default text"  x="97" y="10"

        borderStyle="none"

        borderColor="#FFFFFF"

        borderSkin="{null}"

        dropShadowColor="0xFFFFFF"

        dropShadowEnabled="false"

        borderThickness="0"

        fontFamily="Arial" fontSize="15"/>

       

      thnx

      Luca

        • 1. Re: remove mx:TextInput borders (focus)
          Anitha Selvaraj Level 2

          Hi,

           

          Please check the below code

           

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
              <mx:Script>
                  <![CDATA[
                      private function setBorderThickness():void {
                          this.tIn.styleName = "textInput";
                      }
                  ]]>
              </mx:Script>
              <mx:Style>
                  .textInput {
                      focus-thickness:0;
                  }
              </mx:Style>
              <mx:TextInput id="tIn" text="My default text"  x="97" y="10" 
                  borderStyle="none"  borderColor="#FFFFFF"  borderSkin="{null}" 
                  dropShadowColor="0xFFFFFF"  dropShadowEnabled="false"  borderThickness="0"
                    fontFamily="Arial" fontSize="15" focusIn="setBorderThickness()"/>
          </mx:Application>

           

          Setting the focusThickness as 0 on focusIn event will meet your expectation.

           

          Regards,

          Anitha

          • 2. Re: remove mx:TextInput borders (focus)
            Scaljeri Level 1

            Thnx!

             

            I also found focusAlpha="0"

             

            cheers