# Listener problems

**URL:** <https://forum.kirupa.com/t/listener-problems/172247>\
**Category:** Uncategorized\
**Created:** [December 12, 2005, 7:53pm UTC](https://forum.kirupa.com/t/listener-problems/172247 "2005-12-12T19:53:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brandao](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@brandao](https://forum.kirupa.com/u/brandao)\
**Post date:** [December 12, 2005, 7:53pm UTC](https://forum.kirupa.com/t/listener-problems/172247/1 "2005-12-12T19:53:46Z")

</div>

Hi,

I’m making a shoping cart in flash.

First i get the elements from a database and for each item i create textfields for describing them and at last a combobox to choose the quantity.

I need a listener to each combobox to make the update to the total price when a combobox is changed.

my actual configuration is:

- a container movie clip to put all the cart
- a scrollpane to contain all the item

i put all my actionscripting inside the movieclip that contains everything and it looks like this:

```auto
import mx.containers.ScrollPane;
var transact_sp:ScrollPane;

transact_sp.contentPath = "transact_container";
var path:MovieClip = transact_sp.content;

lo = new Object();
lo.change = function (evt){
trace("i'm here");
}
_root.transact_mc.path["transact_item"+i].quantity_cb.addEventListener("change",lo);

tractionData = new LoadVars();
tractionData.load(mainurl+"transact.php");
tractionData.onLoad = function() {
_global.ntransact = this.ntransact;
for (i=0;i<this.ntransact;i++) {
_root.transact_mc.path.attachMovie("transact_item" ,"transact_item"+i,_root.transact_mc.path.getNextH ighestDepth())
_root.transact_mc.path["transact_item"+i]._y = 10 + (30*i);
_root.transact_mc.path["transact_item"+i].transact_description.text = this["transact"+i+"Title"];
_root.transact_mc.path["transact_item"+i].transact_price.text = this["transact"+i+"Price"] + " £";
_root.transact_mc.path["transact_item"+i].quantity_cb.addEventListener("change",_root.trans act_mc.lo);
_root.transact_mc.transact_sp.invalidate();
}
}

```

the problem is that i’m not having sucess in putting the items combobox’s responding to the events.

i have a combobox in the movieclip that contains everything and it works fine with the listener, but the ones that are referenced by this:

```auto
_root.transact_mc.path["transact_item"+i].quantity_cb.addEventListener("change",_root.trans act_mc.lo);

```

Dont work…

Any tips?

Many thx
