1 Reply Latest reply on Sep 21, 2010 8:40 PM by Shongrunden

    Difference between <s:Group>

    Ashu***

      Dear friends,

      I am trying to get some hands on Flex 4. When it came to choose between VGroup and Group, I am a bit confused. Is there some good reason/distinction between the two, namely VGroup and Group with vertical layout. Which one should a develpoer prefer to get best performance ?

      Thanks in advance.

        • 1. Re: Difference between <s:Group>
          Shongrunden Adobe Employee

          <s:VGroup id="myVGroup">

              ...

          </s:VGroup>

           

          is equivalent to:

           

          <s:Group id="myGroup">
              <s:layout>

                  <s:VerticalLayout id="myGroupLayout" />

              </s:layout>
              ...
          </s:Group>

           

          VGroup is just a Group with a hardcoded layout and exposes all of the properties of VerticalLayout.  It's mainly for convenience, there shouldn't be any performance difference between the two approaches.

           

          VGroup might be handy for you when you want to change properties of the group + the layout with a single object, for example

           

          myVGroup.width = 100;
          myVGroup.gap = 10;

           

          would be equivalent to

           

          myGroup.width = 100;
          myGroupLayout.gap = 10;

           

          The layout of VGroup cannot be changed, if you want to change your layout in the future then consider using a Group.