3 Replies Latest reply on Jan 14, 2011 4:00 AM by jfb00

    Thin client date problem

    capitainequebec

      When I run my application on thin client with AIR, I am not able to get current date with the code:

       

        var startRefDate:Date = new Date;

       

      The startRefDate field is empty, is there a way to correct this problem.

       

      Regards,

      Daniel Cantin

       

       

       

       

       

       

       

       

       

       

        • 1. Re: Thin client date problem
          jfb00 Level 3

          Hi,

          Please try var startRefDate:Date = new Date( );

          Rgds

           

          Johnny

          • 2. Re: Thin client date problem
            capitainequebec Level 1

            I found that my problem is not related to thin client. When I test the desktop application from Flex everything is ok but when I install it with AIR, the application work but I have an event listener who is not triggered. I need this listener to show a time clock on the screen.

             

            Regards,

            • 3. Re: Thin client date problem
              jfb00 Level 3

              Hi,

              Can you elaborate a simple test app with your code?

              It works for me in air.

               

              <?xml version="1.0" encoding="utf-8"?>
              <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="init()">
                  <mx:Script>
                      <![CDATA[
                          import mx.formatters.DateFormatter;
                          
                          private function init():void{
                              var formattedDate:DateFormatter = new DateFormatter();
                              formattedDate.formatString = "DD/MM/YYYY";
                              var DateVar:Date = new Date();
                              myDate.text = formattedDate.format(DateVar);
                          }
                      ]]>
                  </mx:Script>
                  <mx:Label id="myDate" x="138" y="125" fontSize="26"/>
              </mx:WindowedApplication>
              

               

              Rgds

               

              Johnny