I use DateChooser component and I have one general q. how to access the var of the listenerObject - is it possible?
I would like to compare two values:
one in listenerObject fn and second in another fn.
I think is it not possilble, because the created var in fn is local var, isn’t it?
Here is the code example:
// store arival date for arival_dc
var listenerObject:Object = new Object ();
listenerObject.change = function (eventObject:Object)
{
var myDate = new Date (eventObject.target.selectedDate);
var myDay:Number = myDate.getDate ();
var _myMonth:Number = myDate.getMonth () + 1;
var myYear:Number = myDate.getFullYear ();
trace (myDate.getDate ());
// the day of the month
trace (myDate.getMonth () + 1);
// add 1 to the month because getMonth() returns values in the range 0 - 11
trace (myDate.getFullYear ());
_root.createTextField ("myArivalDate_txt", _root.getNextHighestDepth (), 300, 600, 150, 20);
_root.myArivalDate_txt.border = true;
_root.myArivalDate_txt.text = myDay + "." + _myMonth + "." + myYear;
//
};
arival_dc.addEventListener ("change", listenerObject);