2 Replies Latest reply on Jul 31, 2010 8:34 AM by AhmedCogenli

    get width of an element

    AhmedCogenli

      I'm trying to get width of a group element which is dynamically changing with multitouch resizing by user, then if width goes over than 600 a border container should be visible which is currently invisible. how can i do this with event listeners?

       

      Thanks in advance.

        • 1. Re: get width of an element
          pradeep reddy Level 1

          HI,

           

           

          try this (element).measuredWidth;

           

           

          Hope this will help you..!

           

           

          Cheers,

          Pradeep

          • 2. Re: get width of an element
            AhmedCogenli Level 1

            That might work but I am not sure how to implement this to the element,

             

            here are the two elements;

             

                <s:Group id="group" width="400" height="400" x="173" y="123">
                    <mx:Image source="assets/ogo.png" width="295" height="294"/>
                </s:Group>
               
                <s:BorderContainer id="panel" visible="false" width="100" height="300" x="820" y="500" backgroundColor="#FFFFFF">
                    <s:Button label="test"/>      
                </s:BorderContainer>

            Once group's width goes over 600 panel will be visible and vice-versa.

             

            Thanks