# Simple Shopping Cart

**URL:** <https://forum.kirupa.com/t/simple-shopping-cart/207194>\
**Category:** flash\
**Created:** [November 15, 2006, 3:01pm UTC](https://forum.kirupa.com/t/simple-shopping-cart/207194 "2006-11-15T15:01:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![citruscomputers](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@citruscomputers](https://forum.kirupa.com/u/citruscomputers)\
**Post date:** [November 15, 2006, 3:01pm UTC](https://forum.kirupa.com/t/simple-shopping-cart/207194/1 "2006-11-15T15:01:17Z")

</div>

Morning all,

I’m making a shopping cart for a flash site, this is a really simple cart, I already have the form hooked up to versign via php. I’m having trouble with the script which keeps track of the items in the cart and the grand total. On my add to cart button, it basically adds 1 to dynamic text variable but the AS isnt doing math. heres a quick snippet of whats in my add to cart button

```auto
_root.cart.quantity=Number(_root.cart.quantity)+1;

```

My variable reads NaN after pressing add to cart.

thanks in advance!  
-alex:mario:

edit: fixed it, needed

```auto
quantity=0;

```

in my cart clip, I figured if 0 was placed in the dynamic text box via the stage and not AS it would still define quantity as 0, guess not.
