2 Replies Latest reply on May 13, 2008 12:47 AM by sulletf

    dynamic layout change in Application object

    sulletf
      Hi!
      I the following moving from a vertical or horizontal layout of the Application will not have effect.
      Is there any specific method to run for it to work ?

      Thanks

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" >

      <mx:Script>
      <![CDATA[


      private function init():void {
      this.layout= String(layoutType.selectedValue);
      }
      ]]>

      </mx:Script>

      <mx:HBox x="0" y="0">
      <mx:RadioButtonGroup id="layoutType" itemClick="init();"/>
      <mx:RadioButton id="vertical" label="vertical" groupName="layoutType" value="vertical" />
      <mx:RadioButton id="horizontal" label="horizontal" groupName="layoutType" value="horizontal" />
      <mx:RadioButton id="absolute" label="absolute" groupName="layoutType" value="absolute" />
      </mx:HBox>

      <mx:Button label="1" x="50" y="50"/>
      <mx:Button label="2" x="150" y="150"/>
      <mx:Button label="3" x="250" y="250"/>
      </mx:Application>