# Can eventlistener call a setter function?

**URL:** <https://forum.kirupa.com/t/can-eventlistener-call-a-setter-function/330252>\
**Category:** flash\
**Created:** [December 19, 2012, 10:38am UTC](https://forum.kirupa.com/t/can-eventlistener-call-a-setter-function/330252 "2012-12-19T10:38:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FJW](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@FJW](https://forum.kirupa.com/u/FJW)\
**Post date:** [December 19, 2012, 10:38am UTC](https://forum.kirupa.com/t/can-eventlistener-call-a-setter-function/330252/1 "2012-12-19T10:38:34Z")

</div>

Hi once again  
I have a set function…

```auto
// AS3
 public function set toolName(thisTool:String)
        {
   _theTool = thisTool;
        }

```

and an eventlistener

```auto

newTool.addEventListener(MouseEvent.CLICK, clickTool);

```

The ClickTool function

```auto

private function clickTool(event)
  {
   thisTool = event.currentTarget + "";
   switch (thisTool)
   {
    case "[object trowel]":
    _theTool="Trowel";
    break;
}}

```

The problem is that when I use the get function I find that \_theTool is not updated.

```auto

 public function get toolName():String
        {
            return _theTool;
        }

```

Could anyone help me with this please?
