Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-12-2005, 12:05 PM   #1
lpx
Registered User
 
Join Date: Dec 2005
Posts: 49
Default listener problems

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:

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:

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

Dont work...

Any tips?

Many thx
lpx is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problems with web service connector Listener dee001 ActionScript 2.0 1 11-02-2005 07:21 PM
Listener Problems Savignon ActionScript 2.0 0 10-27-2005 03:36 AM
key listener problems ccl28 ActionScript 2.0 4 05-22-2005 09:29 PM
Problems with action listener Girish_inf ActionScript 2.0 1 01-23-2005 06:16 PM
Event handling with Listeners - learning from Java robertpenner ActionScript 1.0 (and below) 2 08-08-2001 11:36 PM


All times are GMT. The time now is 09:39 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.