I had a customer request some help in modifying the default Flex ComboBox behavior such that when the dropdown list was open and a user was scrolling the mousewheel with the mouse outside the dropdown list, the dropdown list would scroll. The default behavior is to close the dropdown list as soon as the user scrolls the mousewheel outside the dropdown list.

Here is what I came up with (Along with some help from Alex H.):

Application.mxml:

<mx:application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*">
    <mx:script>
        <!–[CDATA[
            import mx.managers.SystemManager;

            [Bindable]–>            public var dp: Array = [ {label:"One", data:1},
                {label:"Two", data:2}, {label:"Three", data:3},
                {label:"Four", data:4}, {label:"Five", data:5},
                {label:"Six", data:6},{label:"Seven", data:7},
                {label:"Eight", data:8}];
        ]]>
    </mx:script>
    <mycombobox id="cb" dataprovider="{dp}" width="150">
</mycombobox>
</mx:application>

MyComboBox.mxml:

<mx:combobox xmlns:mx="http://www.adobe.com/2006/mxml" creationcomplete="initMe()">
    <mx:script>
        <!–[CDATA[

                import mx.controls.Alert;
                import mx.events.ListEvent;

        private function initMe():void {
                systemManager.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheel, true);
                }
        private function onMouseWheel(event:MouseEvent):void {
            trace(event.target);
            if (this.dropdown)
            {
                if (this.dropdown.contains(event.target as DisplayObject))
                    return;   // it is already in the drop down;

                else if (this.dropdown.visible)
                {
                    var fakeEvent:MouseEvent = event.clone() as MouseEvent;
                    fakeEvent.localX = 10;
                    fakeEvent.localY = 10;
                    this.dropdown.dispatchEvent(fakeEvent);
                }
            }
            event.stopImmediatePropagation();
        }
        ]]–>
    </mx:script>
</mx:combobox>

This is also a good demonstration of manipulating event propagation by the use of topImmediatePropagation() and then redispatching a MouseEvent faked so that is appears to still be within the ComboBox dropdown list.