Event Flex



    
        
        import mx.collections.ArrayCollection;
        import flash.events.KeyboardEvent;
        import flash.system.System;
        [Bindable]
        private var dpADG:ArrayCollection = new ArrayCollection([
                {Artist:'A', Album:'aa', Price:1.99},
                {Artist:'J', Album:'jj', Price:1.99},
                {Artist:'K', Album:'kk', Price:1.99}
        ]);
        
        private function myKeyUpHandler(event:KeyboardEvent):void
        {
            var keycode_c:uint = 67;
            if (event.ctrlKey && event.keyCode == keycode_c)
            {
                var dataString:String = "";
                var n:int = event.currentTarget.selectedCells.length;
                for (var i:int = 0; i < n; i++)
                {
                    var cell:Object = event.currentTarget.selectedCells[i];
                    var data:Object = event.currentTarget.dataProvider[cell.rowIndex];
                    var dataField:String = event.currentTarget.columns[cell.columnIndex].dataField;
                    dataString = data[dataField] + ' ' + dataString;
                }
                System.setClipboard(dataString);
            }
        }
      
    

                             height="100%"
                         dataProvider="{dpADG}" 
                         selectionMode="multipleCells"
                         allowMultipleSelection="true" 
                         keyUp="myKeyUpHandler(event);">