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);
}
}
}
我需要了解這些內容才能更好地理解。Canyone解釋下面用ActionScript編寫的代碼
什麼是公共靜態const DETAILS:String =「details」;
爲什麼使用static關鍵字。 爲什麼使用const,它是什麼。 爲什麼DETAILS:String有一個值的細節。
public var product:Product;
public function ProductThumbEvent(type:String, product:Product)
{
super(type);
this.product = product;
}
這個構造函數是做什麼的? 超級(類型)是做什麼的? this.product =產品意味着什麼?
override public function clone():Event
{
return new ProductThumbEvent(type, product);
}
他們試圖返回什麼他們爲什麼不能在以前的構造函數中返回,而不是創建上述方法的克隆。
謝謝。
非常感謝您的時間和如此清晰的解釋。 – Kevin 2009-08-05 14:55:50