# How to access the var of the listenerObject - is it possible?

**URL:** <https://forum.kirupa.com/t/how-to-access-the-var-of-the-listenerobject-is-it-possible/175530>\
**Category:** Uncategorized\
**Created:** [January 15, 2006, 3:13pm UTC](https://forum.kirupa.com/t/how-to-access-the-var-of-the-listenerobject-is-it-possible/175530 "2006-01-15T15:13:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jankratochvil](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jankratochvil/32/566_2.png) [@jankratochvil](https://forum.kirupa.com/u/jankratochvil)\
**Post date:** [January 15, 2006, 3:13pm UTC](https://forum.kirupa.com/t/how-to-access-the-var-of-the-listenerobject-is-it-possible/175530/1 "2006-01-15T15:13:39Z")

</div>

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:

```auto
// 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);

```
