2 Replies Latest reply on Apr 14, 2009 10:58 AM by alice_data

    Call to a possibly undefined method setPropertyIsEnumerable?

    alice_data Level 1

      Hi,

       

        I am trying to accomplish using doubleClick events on dateChoosers. Below is the code that is working:

       

           <mx:VBox>
                    <mx:Label text="Simple DateChooser control."/>
                    <mx:DateChooser id="dateChooser1" doubleClickEnabled="true"
                        doubleClick="displayDate2()"
                        change="displayDate(DateChooser(event.target).selectedDate)"/>
                    <mx:Label id="selection"  color="blue" text="Date selected:"/>
                </mx:VBox>

       

        I tried putting in doubleClickEnabled as true in Actionscript, and then call the event, and this is the syntax I used:

       

           //enable the double Click Enabled Property
                          dch.setPropertyIsEnumerable("doubleClickEnabled",true);

                         dch.addEventListener("doubleClick", useDate2);

       

        This did not work, and I got this error instead: 1061: Call to a possibly undefined method setPropertyIsEnumerable through a reference with static type mx.controls:DateChooser.   

       

        I tried to find a suitable import statement to insert in my code, but I am not sure what to put there. Could anyone please give me a hint what to do here to get my code to accept the method?

       

      Thanks in advance.

       

      Alice

        • 2. Re: Call to a possibly undefined method setPropertyIsEnumerable?
          alice_data Level 1

          Hi, Ryan:

           

            Thanks, I got that to work, but it seems like the doubleClick does not allow me to use it on the dateChooser. Here is the code:


              The MXML:

           

                     <mx:VBox id="box2">

                      <mx:DateChooser id="dch" doubleClickEnabled="true"
                            doubleClick="displayDate2()"
                            change="displayDate(DateChooser(event.target).selectedDate)"/>

                   </mx:VBox>


              The same thing in Actionscript, but not working:

           

               dch = new DateChooser();

               dch.addEventListener("change", displayDate);

               dch.doubleClickEnabled = true;

              dch.addEventListener("doubleClick",displayDate2);

            //Got an error saying TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::MouseEvent@20112769 to     

            //mx.events.CalendarLayoutChangeEvent.

               box2.addChild(dch);

           

             Could you give me some pointers on what I have wrong here?


          Thanks for your help.

           

          Alice