package samples.flexstore
{
import flash.events.Event;
public class ProductThumbEvent extends Event
{
public static const DETAILS:String = "details";
public static const BROWSE:String = "browse";
public var product:Product;
public function ProductThumbEvent(type:String, product:Product)
{
super(type);
this.product = product;
}
override public function clone():Event
{
return new ProductThumbEvent(type, product);
}
}
}
I need to know these things for better understanding.
What is public static const DETAILS:String = "details";
Why static keyword is used. Why const used and what is it for. Why does the DETAILS:String have a value details.
public var product:Product;
public function ProductThumbEvent(type:String, product:Product)
{
super(type);
this.product = product;
}
What does this constructor do? What does super(type) do? what does this.product = product implies?
override public function clone():Event
{
return new ProductThumbEvent(type, product);
}
What are they trying to return why can't they return in previous constructor instead of creating a clone of the above method.
Thanks.