2 Replies Latest reply on Oct 21, 2010 3:09 AM by BhaskerChari

    Cannot set date on datefield object

    the_new_mr Level 1

      Hello everyone,

       

      I'm new here but expect to be a regular vistor as I've just started working with Flex 3.  All very interesting stuff

       

      I'm trying to set the date of a datefield object programmatically.

       

      According to the actionscript 3.0 api, it should be possible (according to the following link):

      http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/DateField.h tml#selectedDate

       

       

      I tried doing it using the following code:

       

      var fromDateDateObject:Date = DateField.stringToDate(fromDate, "DD/MM/YYYY");
      var toDateDateObject:Date = DateField.stringToDate(toDate, "DD/MM/YYYY");
                     
      datFrom.selectedDate( fromDateDateObject );
      datTo.selectedDate( toDateDateObject );

       

      However, on the last two lines of code, I get the following error:

      Attempted access of inaccessible method selectedDate through a reference with static type mx.controls:DateField

       

       

      What am I doing wrong?