Archive

Archive for January, 2009

Double click editable List component

January 26th, 2009 Randy No comments

This code is a simple extention of the Flex List component to make a line item editable on double click, not single click which is the default behaviour.

 

Actionscript:
  1. package{
  2.     import mx.controls.List;   
  3.     import flash.events.MouseEvent;
  4.     import mx.events.ListEvent;
  5.  
  6.     public class DoubleClickList extends List{
  7.         public function DoubleClickList(){
  8.             super();
  9.             doubleClickEnabled = true;
  10.             addEventListener(MouseEvent.DOUBLE_CLICK, handleDoubleClick);
  11.             addEventListener(ListEvent.ITEM_EDIT_END, handleItemEditEnd);
  12.         }
  13.        
  14.        
  15.         protected function handleDoubleClick(p_evt:MouseEvent):void{
  16.             var isEventPrevented:Boolean = p_evt.isDefaultPrevented();
  17.             if(!p_evt.isDefaultPrevented()){
  18.                 editable = true;
  19.                 editedItemPosition = {columnIndex:0, rowIndex:selectedIndex};         
  20.             }
  21.         }
  22.         protected function handleItemEditEnd(p_evt:ListEvent):void{
  23.             editable = false;
  24.         }      
  25.     }
  26. }

Categories: Flash development Tags:
Download Full Movie Online Street Kings download movie Behind Enemy Lines II: Axis of Evil download movie The Station Agent download movie Sister Act 2: Back in the Habit download movie Reversible Errors download movie Retrograde download movie Sister Act download movie Radio download movie Prince Valiant download movie Play dead download movie Cry for help download movie Witchboard download movie Conan the barbarian download movie Fire down below download movie Dadnapped download movie Groundhog day download movie