hi all
i am new to AS2.0. with help of some tutorials i trying to study it.
i am using this code to see a product description price and quantity available.
but display in the swf is white.
i have put this code in a frame in fla
fla code:
test.fla
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());
class file
Product.as
class com.ahfx.Product {
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;
}
}
the file and the paths seems to be working fine.both files r in same folder.
i compiled this fla given above and got a swf. but it seems to white with none of the results i expected.
can anyone help me. it will be a great favour for me as a starter.
thankx in advance.