Nice
Now you have to make sure that when the button is fired, it make itself disabled:
rightNav.addToCart.onRelease = function() {
bottomNav.viewCart._visible = true;
var repeated = checkDuplicate(id);
if (repeated == undefined) {
cart[0].push(id);
cart[1].push(item);
cart[2].push(price);
cart[3].push(handling);
cart[4].push(quantity);
} else {
var tempPrice = Number(cart[2][repeated]);
var tempHandling = Number(cart[3][repeated]);
tempPrice += Number(price);
tempHandling += Number(handling);
cart[2][repeated] = tempPrice;
cart[3][repeated] = tempHandling;
cart[4][repeated] += 1;
}
calcTotal();
// Disable button
this.enabled = false;
// Change text:
this.myTextField.text = "Sold Out";
};
But do remember that when they remove the item from the cart, you will have to set the “this.enabled = false;” to “this.enabled = true”, and the text back to normal, to make the button useable again.
Only thing is, Im not sure how this template looks like or works, so I could be writing wrong code here. This is meant for a shop with one button per item. If you have one button for all items, this wont work.
Then youll need something else. What you could do is create an array that holds all items, and when a user goes to an item thats inside the array, you disable the button. If its not in the array, enable the button
hellon emroni ,
yeah its actually one button for all items. im pretty sure ,the template is
http://activeden.net/item/motion-blur-template/39973
i will not post my site as i heard that self promotion is not allowed
i have a swf shop file which has one add to cart button whichj im pretty sure plays function for all items somehow
ill quickly give this a try tho to see what happens