all groups > flash actionscript > february 2005 >
You're in the

flash actionscript

group:

setting a datefield component value?


setting a datefield component value? Joey`Baga'Donutz
2/28/2005 10:49:49 PM
flash actionscript:
Hi, I am brand new to Action Scripting so I appreciate in detail instructions
:) I am using Flash MX 2004Professional. I have 2 DateField components, I
would like to capture the onChanged event of the first datefield component to
set the value of the second datefield component equal to the value of the 1st
datefield component, along with the selected value of the datechooser. Any
suggestions on the best way to accomplish this are MUCH appreciated :) The
below code / syntax isn't working, and I'm not even completely sure WHERE the
best place to put the code is. dbf.onChanged = function(){ // your
statements here dbt.SelectedDate = dbf.SelectedDate; }
dbf.addEventListener('change', dbf) Thanks, -JBD
Re: setting a datefield component value? NSurveyor
2/28/2005 11:25:52 PM
A few mistakes:

dbf.change = function(){
// your statements here
dbt.selectedDate = dbf.selectedDate;
}
dbf.addEventListener("change", dbf);

Place that code on the frame that holds your dbt DateField and your dbf
DateField
Re: setting a datefield component value? Joey`Baga'Donutz
3/1/2005 2:36:15 AM
Beautiful, thanks very much, it works like a charm. Now, if I want to make the
date be equal to one day later then what is in the first datefield (increment
by 1 day), like: dbt.selectedDate = dbf.selectedDate +1; How do I do that?
This doesnt work. Please advise on how to add one day to this date, thanks
again. -JBD
AddThis Social Bookmark Button