Re: [flexcoders] dateField questions?
Alf, It means you intend to access to any datefield field in your application from a generic function in an external AS file, don´t you?. In this case, the argument should be the Datefield id: getCurrentDate(myDateFieldId); function getCurrentDate(myArg) { var myArg;// it must be the id myArg.selectedDate = new Date(); } The id. must be unique. To access to a field in a .mxml file from an external file, you should specify the complete path from the Application tag. For example: main.mxml - mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml; xmnls:myNameSpace=*.. myNameSpace:sample id=sample .. /mx:Application sample.mxml --- ... mx:DateField id=inputDate dateFormatter=formatDate / The path to this datefield is: mx.core.Application.application.sample. inputDate Isaac Bibás Forado [EMAIL PROTECTED] m Para: flexcoders@yahoogroups.com cc: 23/02/2005 22:01 Asunto: Re: [flexcoders] dateField questions? Por favor, responda a flexcoders Hi ibibas, How would I set up a function to accept an argument like this: getCurrentDate(myDateFieldNameHere); I know this isn't correct: function getCurrentDate(myArg) { var myArg; myArg.selectedDate = new Date(); } I would like to make the function generic so I could reuse it on other screens using the same external AS file. thanks, -Art Quoting [EMAIL PROTECTED]: Once created the datefield, use this code in a ActionScript function: inputDate.selectedDate = new Date(); where inputDate: mx:DateField id=inputDate dateFormatter=formatDate / You can format it using this function: function formatDate(item) { var df:DateFormatter = new DateFormatter(); df.formatString = DD/MM/; // this the mask return df.format(item); } Hope it helps...;-) Isaac Bibás Forado Yahoo! Groups Links 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.
RE: [flexcoders] dateField questions?
I think 'new Date()' is today, no? Allen Allen Manning, Technical Director Prismix Ltd t: +44 (0)870 749 1100 f:+44 (0)870 749 1200 w: www.prismix.com From: Clint Tredway [mailto:[EMAIL PROTECTED] Sent: 23 February 2005 18:21To: flexcoders@yahoogroups.comSubject: RE: [flexcoders] dateField questions? use the selectedDate property and set it to a date-Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Sent: Wednesday, February 23, 2005 12:21 PMTo: flexcoders@yahoogroups.comSubject: [flexcoders] dateField questions?Hi All,How does one access the dateField component and set a specific date to bevisible on init? right now by default is comes up blank and showToday onlyhighlights Todays date on the popup dateChooser.Thanks,-ArtYahoo! Groups Links
RE: [flexcoders] dateField questions?
yes, you are correct, but you can pass any date to the dateField and set the selectedDate to that date... -Original Message-From: Allen Manning [mailto:[EMAIL PROTECTED]Sent: Wednesday, February 23, 2005 12:26 PMTo: flexcoders@yahoogroups.comSubject: RE: [flexcoders] dateField questions? I think 'new Date()' is today, no? Allen Allen Manning, Technical Director Prismix Ltd t: +44 (0)870 749 1100 f: +44 (0)870 749 1200 w: www.prismix.com From: Clint Tredway [mailto:[EMAIL PROTECTED] Sent: 23 February 2005 18:21To: flexcoders@yahoogroups.comSubject: RE: [flexcoders] dateField questions? use the selectedDate property and set it to a date-Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Sent: Wednesday, February 23, 2005 12:21 PMTo: flexcoders@yahoogroups.comSubject: [flexcoders] dateField questions?Hi All,How does one access the dateField component and set a specific date to bevisible on init? right now by default is comes up blank and showToday onlyhighlights Todays date onthe popup dateChooser.Thanks,-ArtYahoo! Groups Links
Re: [flexcoders] dateField questions?
Thanks!! worked like a charm. -Art Quoting [EMAIL PROTECTED]: Once created the datefield, use this code in a ActionScript function: inputDate.selectedDate = new Date(); where inputDate: mx:DateField id=inputDate dateFormatter=formatDate / You can format it using this function: function formatDate(item) { var df:DateFormatter = new DateFormatter(); df.formatString = DD/MM/; // this the mask return df.format(item); } Hope it helps...;-) Isaac Bibás Forado Yahoo! Groups Links
Re: [flexcoders] dateField questions?
Hi ibibas, How would I set up a function to accept an argument like this: getCurrentDate(myDateFieldNameHere); I know this isn't correct: function getCurrentDate(myArg) { var myArg; myArg.selectedDate = new Date(); } I would like to make the function generic so I could reuse it on other screens using the same external AS file. thanks, -Art Quoting [EMAIL PROTECTED]: Once created the datefield, use this code in a ActionScript function: inputDate.selectedDate = new Date(); where inputDate: mx:DateField id=inputDate dateFormatter=formatDate / You can format it using this function: function formatDate(item) { var df:DateFormatter = new DateFormatter(); df.formatString = DD/MM/; // this the mask return df.format(item); } Hope it helps...;-) Isaac Bibás Forado Yahoo! Groups Links
RE: [flexcoders] dateField questions?
Hi Tracy, Works great! Here is the code for whoever needs it ;) my AS: getCurrentDate(commDate); My Function: function getCurrentDate(dateField:mx.controls.DateField) { dateField.selectedDate = new Date(); } my MXML: mx:DateField id=commDate/ Quoting Tracy Spratt [EMAIL PROTECTED]: = Take out the re-declaration of var myArg, make sure you pass in a reference not a string and that should work fine. If you will always be passing in a date field, type the argument: public function setCurrentDate(dateField:mx.controls.DateField):Void Tracy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 23, 2005 4:01 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] dateField questions? Hi ibibas, How would I set up a function to accept an argument like this: getCurrentDate(myDateFieldNameHere); I know this isn't correct: function getCurrentDate(myArg) { var myArg; myArg.selectedDate = new Date(); } I would like to make the function generic so I could reuse it on other screens using the same external AS file. thanks, -Art Quoting [EMAIL PROTECTED]: Once created the datefield, use this code in a ActionScript function: inputDate.selectedDate = new Date(); where inputDate: mx:DateField id=inputDate dateFormatter=formatDate / You can format it using this function: function formatDate(item) { var df:DateFormatter = new DateFormatter(); df.formatString = DD/MM/; // this the mask return df.format(item); } Hope it helps...;-) Isaac Bibás Forado Yahoo! Groups Links Yahoo! Groups Links Yahoo! Groups Links
RE: [flexcoders] dateField questions?
use the selectedDate property and set it to a date -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 23, 2005 12:21 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] dateField questions? Hi All, How does one access the dateField component and set a specific date to be visible on init? right now by default is comes up blank and showToday only highlights Todays date on the popup dateChooser. Thanks, -Art Yahoo! Groups Links