Hey Tom,
Does this help? Just a simple example grabbing the date and setting it when the app initializes.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" initialize="displayDate();">
<mx:Script>
function displayDate(date) {
var today_date:Date = new Date();
var date_str:String = (today_date.getDate()+"/"+(today_date.getMonth()+1)+"/"+today_date.getFullYear());
mx.controls.Alert.show(date_str,"Message"); // displays current date in United States date format
selectedDate.text = date_str;
}
function displayDate(date) {
var today_date:Date = new Date();
var date_str:String = (today_date.getDate()+"/"+(today_date.getMonth()+1)+"/"+today_date.getFullYear());
mx.controls.Alert.show(date_str,"Message"); // displays current date in United States date format
selectedDate.text = date_str;
}
</mx:Script>
<mx:DateChooser id="date1" change="displayDate(event.target.selectedDate)"/>
<mx:TextInput id="selectedDate"/>
</mx:Application>
Mike
-----Original Message-----
From: Tom Fitzpatrick <[EMAIL PROTECTED]>
Sent: Mar 9, 2005 3:11 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Default date in DateField
How do I set a default date string in a DateField's text field? Say, I want
the default date shown to be January 1, 2005. I'm able to set the default
date in the popup calendar using selectedDate, but how do I display that in
the text field?
-----Original Message-----
From: Tom Fitzpatrick <[EMAIL PROTECTED]>
Sent: Mar 9, 2005 3:11 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Default date in DateField
the default date shown to be January 1, 2005. I'm able to set the default
date in the popup calendar using selectedDate, but how do I display that in
the text field?
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Michael Griffin 781-395-1254 (H) [EMAIL PROTECTED]