2 Replies Latest reply on Aug 19, 2010 2:26 PM by peteandrus

    sizing a Canvas from right to left?

    peteandrus Level 1

      i have a canvas with a set of buttons on the right, and a TabNavigator on the right. I would like to size this canvas down so that the buttons on the right are visible, but the TabNavigator is not. When a certain button is clicked, the TabNavigator appears. I figured the easiest way to do this is use a resize effect, but the problem is that when i reduce the width it retracts from the right side, moving my buttons on the right side out of view. How can i have it reduce in size starting from the left, or is this a dumb way to accomplish this goal? any suggestions? thanks!

        • 1. Re: sizing a Canvas from right to left?
          Subeesh Arakkan Level 4

          Hi,

           

          Try to use realtive positioning instead of absoulte positioning. For eaxmple, in your Canvas , for positiong the Button to the right, set its right property instead of x.

           

               <mx:Canvas width="500" height="400">
                    <mx:Button right="20" top="10"/>
                    <mx:TabNavigator right="300"/>
               </mx:Canvas>
          

           

           

          In this way even if the container is resized, the button will always be aligned to the right. You can also turn off scroll policies if it shows scrollbars.

          • 2. Re: sizing a Canvas from right to left?
            peteandrus Level 1

            oh awesome. i didn't realize that this existed. i knew it couldn't be hard with Flex, but i continue to learn something new every day. thanks!