Learn Actionscript - AHFX

Advanced Actionscript 

ahfx actionscript learning actionscript

AHFX Actionscript Home
Basic Actionscript
Intermediate Actionscript
Advanced Actionscript
About AHFX
Contact AHFX
Great Actionscript Links
 
 
 
 

Actionscript 2.0 Add to Cart Script

Now all we have to do is create some buttons to add our new products to our shopping cart. Create a simple button and add the following actionscript to the button:

on (press){
   import com.ahfx.Product;
   var my1Product = new Product();
   my1Product.setQuantity(1);
   my1Product.setPrice(22.99);
   my1Product.setDesc("Donate to AHFX");
   _root.shop_cart.addElement(my1Product);
   delete my1Product;
   _root.displayCart();
}

You have successfully added a new product to your cart.

Return to AHFX Home Page


SUPPORT THIS SITE
If this tutorial helped you, show your support and send me something from my wish list.
Click on an item below and then choose
Adam Hayes (Gift Registry Address) for the Ship to Address.
It is that easy!
 

 

Featured Tutorials

Flash Shopping Cart Tutorial
Create a custom Flash Shopping Cart that will add, update, and show products.

Flash MX 2004 Custom Actions
Take your custom classes to the next level and have Flash treat them as built in classes.

Pass Variables to Flash
Quick and dirty way of passing variables to your flash animations.

Affordable Web Design and Hosting
Find out how you can cut your overhead by hosting with AHFX.net

Affordable Custom Art
Get your pictures custom framed. Amazing Prices. Outstanding Quality.


 
AH Digital FX Studios
Disclaimer | Site Map | Idaho Web Design