3 Replies Latest reply on Oct 27, 2009 12:52 PM by Handycam

    Double-click item to trigger button event?

    Handycam Level 1

      I have two lists with a button that adds the selected item in the first list to the second list:

      Screen shot 2009-10-27 at 3.04.59 PM.jpg

      Is there a way to double-click the item and have it do the same as the button?

        • 1. Re: Double-click item to trigger button event?
          Handycam Level 1

          FWIW, I tried this and can't even get the trace statement to fire:

           

          <s:ItemRenderer xmlns:s="library://ns.adobe.com/flex/spark" xmlns:fx="http://ns.adobe.com/mxml/2009" 
          xmlns:d="http://ns.adobe.com/fxg/2008/dt" xmlns:mx="library://ns.adobe.com/flex/halo"
          width="150" height="150" doubleClick="doubleClickHandler(event)">
               <fx:Script>
                    <![CDATA[
                         protected function doubleClickHandler(event:MouseEvent):void
                         {
                             this.dispatchEvent(new Event("DBL_CLICK_ITEM", true));
                             trace("double click");
                         }
                    ]]>
               </fx:Script>
          ...
          

           

          I also tried it on the items in the renderer, a VGroup containing an image and a label.

          • 2. Re: Double-click item to trigger button event?
            Peter deHaan Level 4

            I haven't tested this locally, but does it help if you set the doubleClickEnabled property to true for the ItemRenderer? (I believe it is false by default)

             

            Peter