Use HGroup to layout Label, CheckBoxes : Group « Container « Flex






Use HGroup to layout Label, CheckBoxes

Use HGroup to layout Label, CheckBoxes
     
<?xml version='1.0' encoding='UTF-8'?>
<mx:Application
     xmlns:s="library://ns.adobe.com/flex/spark" 
     xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        import mx.controls.Alert; 
        public function showMsg(msg:String):void { 
            Alert.show(msg); 
        }
    </mx:Script>
    <mx:RadioButtonGroup id="myRadioButtonGroup" itemClick="showMsg('User picked ' + event.currentTarget.selectedValue)" />
    <mx:Panel width="400" height="150" title="Profile" horizontalCenter="0" verticalCenter="0">
        <s:HGroup>
            <mx:Label text="Your hobbies:" />
            <mx:CheckBox id="cbVideoGames" label="Video Games"
                click="showMsg('Video Games is ' + cbVideoGames.selected)" />
            <mx:CheckBox id="cbFishing" label="Fishing"
                click="showMsg('Fishing is ' + cbFishing.selected)" />
        </s:HGroup>
        <s:HGroup>
            <mx:Label fontWeight="bold" text="Do you like spam:" />
            <mx:RadioButton id="rbYes" value="Yes" groupName="myRadioButtonGroup"
                click="showMsg('Yes')" label="Yes" />
            <mx:RadioButton id="rbNo" value="No" groupName="myRadioButtonGroup"
                click="showMsg('No')" label="No" />
        </s:HGroup>

    </mx:Panel>
</mx:Application>

   
    
    
    
    
  








Related examples in the same category

1.Using multiple containers for more complex layouts
2.Using an HGroup inside of a panel to add a margin from edge
3.Contain an HGroup (horizontal group) containerContain an HGroup (horizontal group) container
4.Spark HGroup ContainerSpark HGroup Container
5.Three images in an HGroup container.Three images in an HGroup container.
6.Creates a Button control inside the HGroup containerCreates a Button control inside the HGroup container
7.Spark Group Container Row HeightSpark Group Container Row Height
8.Use VGroup containerUse VGroup container
9.Force the VGroup containers to be included in the test script's hierarchyForce the VGroup containers to be included in the test script's hierarchy
10.Color property for a VGroup control is blue.Color property for a VGroup control is blue.
11.Group element add eventGroup element add event
12.Use a Spark Group container with three child controls, where the Group container lays out its children verticallyUse a Spark Group container with three child controls, where the Group container lays out its children vertically
13.Show a Spark Group container that contains a child Image controlShow a Spark Group container that contains a child Image control
14.Add scroll bars to the Spark Group container by wrapping the container in the Scroller componentAdd scroll bars to the Spark Group container by wrapping the container in the Scroller component
15.Make Group container the child of the Scroller componentMake Group container the child of the Scroller component
16.Add element to Group with ActionScriptAdd element to Group with ActionScript
17.Set default vertical alignment of top for HorizontalLayout to align the children of a Group container to container bottomSet default vertical alignment of top for HorizontalLayout to align the children of a Group container to container bottom
18.Group container myGroup is the viewport for this scrollerGroup container myGroup is the viewport for this scroller
19.Controlling layout using view states groupsControlling layout using view states groups
20.Create a Group container with an Button controlCreate a Group container with an Button control
21.A Group container with four Button controls as its children:A Group container with four Button controls as its children:
22.containers Viewport Setcontainers Viewport Set
23.Grouping Graphic objects togetherGrouping Graphic objects together
24.Set rowHeight property to a pixel value large enough for all the childrenSet rowHeight property to a pixel value large enough for all the children
25.Group ButtonsGroup Buttons