4 Replies Latest reply on Apr 19, 2010 10:14 AM by The Bruder

    Is there a way to make the spark checkbox directional?

    The Bruder Level 1

      Hi All,

       

      Is there a (easy) way to make the checkbox with the text on the left to the quare?

       

      Thanks in advance,

      Lior

        • 1. Re: Is there a way to make the spark checkbox directional?
          David_F57 Level 5

          hi,

           

          pretty straight forward - new skin(which can be reused once you have it

           

          the main group change from

           

             <s:Group verticalCenter="0" width="13" height="13">

           

          to

           

             <s:Group verticalCenter="0" width="13" height="13" right="0">

           

           

          the label change to

           

              <s:Label id="labelDisplay"

                       textAlign="right"

                       verticalAlign="middle"

                       maxDisplayedLines="1"

                       left="0" right="18" top="3" bottom="3" verticalCenter="2" />

           

          David

          • 2. Re: Is there a way to make the spark checkbox directional?
            The Bruder Level 1

            David,

             

            How can i make the skin change dynamically from left to right?

             

            i want to built a component based on the checkbox (listed below) , and change the skin according to the direction selected by the user.

             

            Can you please tell me what is the best way to do it?

             

            Lior

             

            ** The "DirectionalCheckbox" component

             

            <?xml version="1.0" encoding="utf-8"?>
            <s:CheckBox xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        xmlns:mx="library://ns.adobe.com/flex/mx">
               
                <fx:Script>
                    <![CDATA[
                        import flashx.textLayout.formats.Direction;
                       
                        private var _checkBoxDireciton:String = Direction.LTR;
                       
                        [Bindable]
                        public function get checkBoxDireciton():String
                        {
                            return _checkBoxDireciton;
                        }

             

                        public function set checkBoxDireciton(value:String):void
                        {
                            _checkBoxDireciton = value;
                        }

             

                    ]]>
                </fx:Script>
               
            </s:CheckBox>

            • 3. Re: Is there a way to make the spark checkbox directional?
              Shongrunden Adobe Employee

              If you are using a recent nightly build you might be able to take advantage of the new mirroring feature.

               

              <s:VGroup>
                  <s:CheckBox label="left" layoutDirection="rtl" />
                  <s:CheckBox label="right" />
              </s:VGroup>

               

              If you are using Flex 4.0.0 release then as David mentioned it's best to reskin. 

               

              See http://butterfliesandbugs.wordpress.com/2010/03/08/support-for-right-to-left-layouts-in-fl ex-4-x-aka-mirroring/ for more information on layout mirroring.

              1 person found this helpful
              • 4. Re: Is there a way to make the spark checkbox directional?
                The Bruder Level 1

                I will try the new SDK.

                 

                Thanks a lot!