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


If this FREE tutorial helped you at all, please consider clicking on a link to help support this site.
---OR---
Donate to the cause by sending us an Amazon Gift Certificate.
Click Here to Send an Amazon Gift Certificate to info@ahfx.com

 


 

Creative suite generic 125x125

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.

Web Hosting from $15/month
Find out how you can cut your overhead by hosting with AHFX.net

Ski Hats
Buy Ski Hats from Getaklu

Premium Financing
Premium Financing with Premium Financial Advisors


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