9 Replies Latest reply on Apr 4, 2007 1:02 AM by chris.huston.t10

    timer in flex


      i have written a small piece of code to display current date and time, when i run the following application i am getting error

      "ArgumentError: Error #1063: Argument count mismatch on date/::getdate(). Expected 0, got 1."

      plz find me solution for that

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()" >

      import flash.utils.Timer;
      import flash.events.TimerEvent;
      import flash.utils.setInterval;

      var now:Date = new Date();

      private var timer:Timer;

      private function init():void
      timer = new Timer(1000);
      timer.addEventListener(TimerEvent.TIMER, getdate);

      private function getdate():String
      return now.toLocaleDateString().toString() + " | " + now.toLocaleTimeString().toString()


      <mx:TextInput id="nothing" text="{getdate()}" />