![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
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"> <mx:Script> <![CDATA[ public function timestamp() ate{var timestamp ate = new Date();return timestamp; } ]]> </mx:Script> <mx:Label text="{timestamp()}" color="#FEFEFE" height="20" y="10" textAlign="left" enabled="true"/> </mx:Canvas> The label was as {timestamp()}, not the Date information. The curly brace does not work here. |
| Sponsored Links |
|
|||
|
I'm using Flex3 Builder. I can not run the code as it is just a MXML component.
I was hoping to see the time under the "design" tab, but it only shows the {timestamp()}. Once I embed the code in <mx:Application ...> </mx:Application>, I got a compilation error that says timestamp() is a duplicated function definition and incompatible override. I changed the function to timestamp2() and run it, the time shows up. Is there a standard pre-defined timestamp function in Flex3? |
|
|||
|
When I put your code directly in an app it works fine:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ public function timestamp() ate{var timestamp ate = new Date();return timestamp; } ]]> </mx:Script> <mx:Canvas width="738" height="36" backgroundColor="#05075C"> <mx:Label text="{timestamp()}" color="#FEFEFE" height="20" y="10" textAlign="left" enabled="true"/> </mx:Canvas> </mx:Application> |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise