3 Replies Latest reply on Oct 16, 2008 9:13 AM by Gregory Lafrance

    Display the function return in a label

      I'm writing a MXML component to display the timestamp in a label:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" width="738" height="36" backgroundColor="#05075C">
      public function timestamp():Date{
      var timestamp:Date = new Date();
      return timestamp;
      <mx:Label text="{timestamp()}" color="#FEFEFE" height="20" y="10" textAlign="left" enabled="true"/>
      The label was displayed as {timestamp()}, not the Date information. The curly brace does not work here.