# Need help with this shopping cart code please

**URL:** <https://forum.kirupa.com/t/need-help-with-this-shopping-cart-code-please/296663>\
**Category:** flash\
**Created:** [September 17, 2009, 9:19pm UTC](https://forum.kirupa.com/t/need-help-with-this-shopping-cart-code-please/296663 "2009-09-17T21:19:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![md\_\_](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@md\_\_](https://forum.kirupa.com/u/md__)\
**Post date:** [September 17, 2009, 9:19pm UTC](https://forum.kirupa.com/t/need-help-with-this-shopping-cart-code-please/296663/1 "2009-09-17T21:19:05Z")

</div>

when i try and view the output of my code in the fla file i get an error does anyone know why

This my as file

class com.ahfx.Product {

//Instance Variables  
private var price:Number;  
private var desc:String;  
private var quantity:Number;

function Product() {

}

function getPrice():Number {  
return price;  
}

function setPrice(myVar:Number):Void {  
price = myVar;  
}

function getQuantity():Number {  
return quantity;  
}

function setQuantity(quantity:Number):Void {  
this.quantity = quantity;  
}

function getDesc():String {  
return desc;  
}

function setDesc(myVar:String):Void {  
desc = myVar;  
}

function getTotal():Number {  
return price\*quantity;  
}

}

This is my fla file code  
which is on a keyframe

import com.ahfx.Product;  
var myProduct = new Product();  
myProduct.setQuantity(3);  
myProduct.setPrice(2.99);  
myProduct.setDesc(“Teddy Bear”);

trace(myProduct.getDesc());  
trace(myProduct.getPrice());  
trace(myProduct.getQuantity());  
trace(myProduct.getTotal());
