Adobe Dreamweaver Forums



Last 10 THreads :         Can't upload selected pdf's to remote server (Last Post : DontTazeMeBro - Replies : 3 - Views : 4 )           »          dreamweaver v. movable type? (Last Post : Murray *ACE* - Replies : 2 - Views : 3 )           »          Disabling menu bars in a browser window (Last Post : Dooza - Replies : 4 - Views : 5 )           »          drop down menu over flash (Last Post : Murray *ACE* - Replies : 1 - Views : 2 )           »          uploading site (Last Post : hrggroup - Replies : 4 - Views : 5 )           »          Can Anyone Help With Sub Menus (Last Post : Murray *ACE* - Replies : 6 - Views : 7 )           »          help with DWCS3 (Last Post : Murray *ACE* - Replies : 4 - Views : 5 )           »          Repeater and XML problem (Last Post : ntsiii - Replies : 2 - Views : 4 )           »          Focus, Browsers & Spry Accordion (Last Post : CORDFrank - Replies : 5 - Views : 7 )           »          Navigation from Contact Form (Last Post : sw2gtg - Replies : 3 - Views : 6 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 10-31-2008, 06:27 PM
glen08
 
Posts: n/a
Diggs:
Default 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">
<mx:Script>
<![CDATA[
public function timestamp()ate{
var timestampate = 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.



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-31-2008, 06:27 PM
dietmar.paulus
 
Posts: n/a
Diggs:
Default Re: Display the function return in a label

Hi

I tried your code and the label displayed the time, so I don't see a text like {timestamp()}.

Cheers

dietmar
Reply With Quote
  #3 (permalink)  
Old 10-31-2008, 06:27 PM
glen08
 
Posts: n/a
Diggs:
Default Re: Display the function return in a label

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?

Reply With Quote


  #4 (permalink)  
Old 10-31-2008, 06:27 PM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: Display the function return in a label

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 timestampate = 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>

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 06:01 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk