| 套件 | 最上層 |
| 類別 | public dynamic class ArgumentError |
| 繼承 | ArgumentError Error Object |
| 語言版本 : | ActionScript 3.0 |
| Player 版本 : | Flash Player 9 |
請參閱
| 方法 | 定義自 | ||
|---|---|---|---|
|
ArgumentError(message:String = "")
會建立 ArgumentError 物件。
| ArgumentError | ||
![]() |
建構錯誤時,會傳回字串形式的錯誤呼叫堆疊 (僅限 Flash Player 的除錯程式版本)。
| Error | |
![]() |
指出物件是否有已定義的指定屬性。
| Object | |
![]() |
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。
| Object | |
![]() |
指出指定的屬性是否存在,以及是否可列舉。
| Object | |
![]() |
為迴圈作業設定動態屬性的可用性。
| Object | |
![]() |
預設會傳回字串 "Error",或 Error.message 屬性 (如果已定義) 中包含的值。
| Error | |
![]() |
會傳回指定之物件的基本值。
| Object | |
| ArgumentError | () | 建構函式 |
public function ArgumentError(message:String = "")
| 語言版本 : | ActionScript 3.0 |
| Player 版本 : | Flash Player 9 |
會建立 ArgumentError 物件。
參數message:String (default = "") — 與錯誤關聯的字串。
|
ArgumentError 錯誤以及在 try..catch 陳述式中處理。 println() 函數可接受一個引數、一個單一字串,但如果提供了兩個字串,則會擲回錯誤。 一般來說,編譯器可能會捕捉這類錯誤,但是 try 陳述式中的 this[] 語法會略過編譯器對於此函數的語法檢查。
package {
import flash.display.Sprite;
public class ArgumentErrorExample extends Sprite {
public function ArgumentErrorExample() {
println("Hello World");
try {
this["println"]("Hello", "World");
}
catch(e:ArgumentError) {
trace(e);
}
}
public function println(str:String):void {
trace(str);
}
}
}
目前頁面: http://livedocs.adobe.com/flash/9.0_tw/ActionScriptLangRefV3/ArgumentError.html