Call JavaScript when double clicked the List item : List « Components « Flex






Call JavaScript when double clicked the List item

Call JavaScript when double clicked the List item
           
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  layout="horizontal">
  <mx:Script>
    
    private function onDoubleClick( event:Event ) : void {
          ExternalInterface.call('itemSelected', theList.selectedItem );
    }
    
  </mx:Script>
  <mx:List id="theList" width="300" doubleClick="onDoubleClick(event);" doubleClickEnabled="true">
    <mx:dataProvider>
      <mx:Array>
        <mx:String>A</mx:String>
        <mx:String>B</mx:String>
        <mx:String>C</mx:String>
      </mx:Array>
    </mx:dataProvider>
  </mx:List>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Populating List using ActionScriptPopulating List using ActionScript
2.Using a List component to display a single column of namesUsing a List component to display a single column of names
3.Create List from ObjectsCreate List from Objects
4.Create a static List controlCreate a static List control
5.Set the verticalAlign for ListSet the verticalAlign for List
6.Set the variableRowHeight for ListSet the variableRowHeight for List
7.Set wordWrap and variableRowHeightSet wordWrap and variableRowHeight
8.Remove from ListRemove from List
9.Remove an item from listRemove an item from list
10.Replace item in a ListReplace item in a List
11.Set Icons for Items in a ListSet Icons for Items in a List
12.Double click to edit ListDouble click to edit List
13.Spark List Caret IndexSpark List Caret Index
14.Spark List with alternating Item ColorsSpark List with alternating Item Colors
15.List rollover colorList rollover color
16.List IconList Icon
17.A List control uses the iconFunction property to determine the icon to display for each itemA List control uses the iconFunction property to determine the icon to display for each item
18.Give a list of color namesGive a list of color names
19.If items do not fit in the size of the control, Flex automatically display scroll barsIf items do not fit in the size of the control, Flex automatically display scroll bars