20
Sep
08

Toggling item roll over highlighting on a List control in Flex

The following example shows how you can toggle item roll over highlighting on a Flex List control by setting the useRollOver style.

Full code after the jump.

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/09/20/toggling-item-roll-over-highlighting-on-a-list-control-in-flex/ -->
<mx:Application name="List_useRollOver_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">

    <mx:Array id="arr">
        <mx:Object label="Button"
                icon="@Embed('assets/Button.png')" />
        <mx:Object label="ButtonBar"
                icon="@Embed('assets/ButtonBar.png')" />
        <mx:Object label="CheckBox"
                icon="@Embed('assets/CheckBox.png')" />
        <mx:Object label="ColorPicker"
                icon="@Embed('assets/ColorPicker.png')" />
        <mx:Object label="ComboBox"
                icon="@Embed('assets/ComboBox.png')" />
        <mx:Object label="DataGrid"
                icon="@Embed('assets/DataGrid.png')" />
        <mx:Object label="DateChooser"
                icon="@Embed('assets/DateChooser.png')" />
        <mx:Object label="DateField"
                icon="@Embed('assets/DateField.png')" />
        <mx:Object label="HorizontalList"
                icon="@Embed('assets/HorizontalList.png')" />
        <mx:Object label="HRule"
                icon="@Embed('assets/HRule.png')" />
        <mx:Object label="HScrollBar"
                icon="@Embed('assets/HScrollBar.png')" />
        <mx:Object label="HSlider"
                icon="@Embed('assets/HSlider.png')" />
    </mx:Array>

    <mx:ApplicationControlBar dock="true">
        <mx:Form styleName="plain">
            <mx:FormItem label="useRollOver:">
                <mx:CheckBox id="checkBox" selected="true" />
            </mx:FormItem>
        </mx:Form>
    </mx:ApplicationControlBar>

    <mx:List id="list"
            dataProvider="{arr}"
            useRollOver="{checkBox.selected}"
            verticalScrollPolicy="on"
            width="150" />

</mx:Application>

0 Responses to “Toggling item roll over highlighting on a List control in Flex”


  1. No Comments

Leave a Reply

This blog is terrible at eating HTML tags. If you plan on posting code/XML, please escape your "<" characters as "&lt;" and your ">" characters as "&gt;".




September 2008
M T W T F S S
« Aug   Oct »
1234567
891011121314
15161718192021
22232425262728
2930  

Badge Farm

  • Powered by Redoable 1.2
  • Cornify
  • Feeds burnt by Feedburner
  • Feed