I have a small cart i’m building and would like to build a button to remove an item. SO this is my code, problem is, it goes into negatives after it hits $0. How can I stop it at $0?
on (release) { tellTarget (””) { product.quantity1.text = Number(product.quantity1.text)-1; product.total1.text = Number(product.quantity1.text)*45; }
}
product.quantity1.text = Number(product.quantity1.text)-1;
to
product.quantity1.text = Math.max(Number(product.quantity1.text)-1 , 0);
You rock man, thank you!
My pleasure . 
One more question while I gotcha =)
What if we wanted it to do something at 0?
something like if 0 gotoandplay
if(Number(product.quantity1.text) == 0)
{
// your scripts
}
or if you want execute something before 0 apply to text files
var tempQuality:Number = Math.max(Number(product.quantity1.text), 0);
if(tempQuality == 0)
{
// your scripts
}
else
{
product.quantity1.text = tempQuality;;
product.total1.text = tempQuality*45;
}
So freakin awesome. Thank you thank you !
No problem 
