View Full Version : listener problems

12-12-2005, 12:05 PM

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:

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");

tractionData = new LoadVars();
tractionData.onLoad = function() {
_global.ntransact = this.ntransact;
for (i=0;i<this.ntransact;i++) {
_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"] + " ";

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:


Dont work...

Any tips?

Many thx