Looks ok to me. Is there some specific issue we should look at? The
expectation is that this is for a shopping cart and the number of items won’t
be very big. If you had 100,000 items, recomputing on every change could be
slow, and then you might try to get smarter by looking at the event’s
Add a switch statement for event.kind, keep the last sum around, and modify it
as appropriate.
On 12/21/11 11:51 AM, ZIONIST stinas...@yahoo.com wrote:
How do you do that?
--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui
We need someone to monitor this list from a management prospective. The
spams of srikanth reddy are becoming annoying. Flip a flag and I'll be
happy to jump in limited to removing spam and spammers.
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
Behalf Of Alex Harui
I didn’t see any code that actually changes the quantity in the data object.
The TextInput gets its initial value from the data via databinding, and the
change event calls something, but:
1. you don’t want to update on change, but rather on focusOut or itemEditEnd
(otherwise, as you type
public function *deleteOrder*():void{
orderColl.removeItemAt(products.selectedIndex);
*init()*
}
private function *addProduct*():void
{
//Create an object to hold the data
var obj:Object=new Object();
//Assign the variables to it
obj.Product=product.text;
obj.Price=price.text;
//Add the object
You know there is an working example in this book pretty close to your, is flex
4 though but you will get the picture.
http://www.amazon.com/Adobe-Flex-Training-Michael-Labriola/dp/0321660501
C
From: ZIONIST stinas...@yahoo.com
To:
I haven’t been following this thread, and without looking at the book:
If you assume there won’t be more than 100 things in the cart, it is just as
easy to add them all up every time there is a change. Then some setup code
should call:
private function updateTotal(){
var summ:Number=0
for(i:String in orderColl){
summ+=orderColl[i]
}
total=summ
sum.text=total
}
and call this function at the end of init, addProduct, deleteOrder
functions.
On Tue, Dec 6, 2011 at 4:19 AM, ZIONIST stinas...@yahoo.com wrote:
Tried that but it
if i get your problem right, this will help. however, i didn't match the
name of the arraycollection to yours
var sum:Number=0
for(i:String in arraycollectionvar){
sum+=arraycollectionvar[i];
}
//here is the sum you need.
On Mon, Dec 5, 2011 at 3:57 PM, ZIONIST stinas...@yahoo.com wrote:
9 matches
Mail list logo