IT기술/Flex

flex 22 TileList.mxml

dobbby 2008. 11. 24. 17:10
반응형




TileListTest.mxml
<?xml version="1.0"?>
<!-- Simple example to demonstrate the TileList Control. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

    <mx:Script>
        <![CDATA[

[Bindable]
[Embed(source="img/1.jpg")]
public var phone1:Class;

         
[Bindable]
[Embed(source="img/2.jpg")]
public var phone2:Class;
            
[Bindable]
[Embed(source="img/3.jpg")]
public var phone3:Class;
        
[Bindable]
[Embed(source="img/4.jpg")]
public var phone4:Class;

             [Bindable]
             [Embed(source="img/5.jpg")]
             public var phone5:Class;
             import mx.controls.Alert;
             public function show():void{
                  mx.controls.Alert.show(CameraSelection.selectedItem.label);
             }
        ]]>
    </mx:Script>

    <mx:Panel title="TileList Control Example" height="350" width="690"
        paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">

        <mx:Label width="100%" color="blue"
            text="A TileList control displays items in rows and columns."/>

        <mx:TileList id="CameraSelection" height="250" width="650"
            maxColumns="5" rowHeight="250" columnWidth="125" textAlign="center" click="show()">
            <mx:dataProvider>
                <mx:Array>
                    <mx:Object label="Nokia 6630" icon="{phone1}"/>
                    <mx:Object label="Nokia 6680" icon="{phone2}"/>
                    <mx:Object label="Nokia 7610" icon="{phone3}"/>
                    <mx:Object label="Nokia LGV" icon="{phone4}"/>
                    <mx:Object label="Nokia LMV" icon="{phone5}"/>
                </mx:Array>
            </mx:dataProvider>
        </mx:TileList>
    </mx:Panel>
</mx:Application>

반응형