Display the function return in a label
i'm writing mxml component display timestamp in label:
<?xml version="1.0" encoding="utf-8"?>
<mx:canvas xmlns:mx=" http://www.adobe.com/2006/mxml" width="738" height="36" backgroundcolor="#05075c">
<mx:script>
<![cdata[
public function timestamp():date{
var timestamp:date = new date();
return timestamp;
}
]]>
</mx:script>
<mx:label text="{timestamp()}" color="#fefefe" height="20" y="10" textalign="left" enabled="true"/>
</mx:canvas>
the label displayed {timestamp()}, not date information. curly brace not work here.
<?xml version="1.0" encoding="utf-8"?>
<mx:canvas xmlns:mx=" http://www.adobe.com/2006/mxml" width="738" height="36" backgroundcolor="#05075c">
<mx:script>
<![cdata[
public function timestamp():date{
var timestamp:date = new date();
return timestamp;
}
]]>
</mx:script>
<mx:label text="{timestamp()}" color="#fefefe" height="20" y="10" textalign="left" enabled="true"/>
</mx:canvas>
the label displayed {timestamp()}, not date information. curly brace not work here.
hi
i tried code , label displayed time, don't see text {timestamp()}.
cheers
dietmar
i tried code , label displayed time, don't see text {timestamp()}.
cheers
dietmar
More discussions in Flex (Read Only)
adobe
Comments
Post a Comment