all groups > flash (macromedia) > may 2006 >
You're in the

flash (macromedia)

group:

date chooser calander


date chooser calander magera
5/28/2006 3:52:20 AM
flash (macromedia):
I am attempting to make a calander/organiser that can have notes added to dates
and displays them in a textbox when each date is selected. I am using the date
chooser ui and have found no tutorials that can help. It will be used on one
machine with one username so i can use local storage and be compiled as a
standalone. If anyone can help or has a tutorial that they know of it would be
much appreciated.
Re: date chooser calander NSurveyor
5/28/2006 8:22:13 PM
This is a very simple example. Just have a dynamic textfield, with instance
name, tit_txt, an input textfield with instance name my_txt, and a date chooser
component with instanc e name my_dc. Then, place the attached code on frame 1.
You could probably make this better if you put a clear button, which would
simply run my_so.clear(); Also, loop through my_so and populate a list with
the dates, and then make it so you can click on a date in the list to go to the
date.

my_so = SharedObject.getLocal('cal');

my_dc.change = function(){
var d = this.selectedDate;
if(d == undefined){
tit_txt.text = 'NOTES:';
my_txt.text = 'NO DATE SELECTED';
my_txt.type = 'dynamic';
my_txt.selectable = false;
}else{
tit_txt.text = 'NOTES FOR '+d.format()+' :';
my_txt.type = 'input';
my_txt.selectable = true;
if(my_so.data[d.format()] == undefined){
my_so.data[d.format()] = '';
my_so.flush();
}
my_txt.text = my_so.data[d.format()];
}
}
my_txt.onChanged = function(){
my_so.data[my_dc.selectedDate.format()] = this.text;
my_so.flush();
}
Date.prototype.format = function(){
var str = '';
if(this.getMonth()+1<10)str+='0';
str+=(this.getMonth()+1)+'/';
if(this.getDate()<10)str+='0';
str+=(this.getDate())+'/';
str+=(this.getFullYear());
return str;
}
my_dc.addEventListener('change',my_dc);
my_dc.selectedDate = new Date();
my_dc.change();
Re: date chooser calander magera
5/29/2006 12:00:00 AM
thanks, i am surprised that i could not find any tutorials on this, thank
goodness for forums. Also i am not sure what you mean by "loop through my_so
and populate a list with the dates" I am assuming it means link the two
components (date chooser and list) I am not sure how to do this either. Is
there anything that can help me learn about local storage etc. as i am also
trying to add an address book function into the same flash file ( i have
already tried the colin mook tutorial but it has not been updated for newer
releases and does not help.)
AddThis Social Bookmark Button