I’m trying to dynamically load text, which usually isnt too darn tough, but i’m trying something i’ve never done before… I dont know how to explain it, so i’ll just put the code in here. Your looking at my listener object for date chooser component. I have a txt file that should have corresponding var names (i.e. &05/02/2005=some text for the day) but all that shows up in the dynamictxtbox is undefined. I’m pulling my hair out over this, why does it not work?
myDateListener = new Object();
myDateListener.change = function(eventObj){
var eventSource = eventObj.target;
var theSelectedDate = eventSource.selectedDate;
// format the date
var theDate = theSelectedDate.getDate();
var theMonth = theSelectedDate.getMonth() + 1;
var theYear = theSelectedDate.getFullYear();
var formattedDate = theMonth + “/” + theDate + “/”+ theYear;
// display the message
loadText = new LoadVars();
loadText.load(“calendar.txt”);
loadText.onLoad = function() {
calendarINFO.htmlText = this.formattedDate;
};
}
myDateChooser.addEventListener (“change”, myDateListener);
i’ve tried just displaying something like :
calendarINFO.htmlText = formattedDate;
and that works fine. So why wont it work as load dynamically with the var name?
thanks to whoever can tell me whats goin on with this