| パッケージ | flash.events |
| クラス | public class ErrorEvent |
| 継承 | ErrorEvent TextEvent Event Object |
| サブクラス | AsyncErrorEvent, IOErrorEvent, SecurityErrorEvent, SkinErrorEvent |
| 言語バージョン : | ActionScript 3.0 |
| Player のバージョン : | Flash Player 9 |
error イベントのタイプは ErrorEvent.ERROR のみです。
ErrorEvent クラスも IOErrorEvent クラスおよび SecurityErrorEvent クラスの基本クラスとして機能します。
デバッグ版の Flash Player を使用すると、リスナーのない error イベントを確認できます。デバッグ版の Flash Player では、このようなイベントはストリングで表示されます。ストリングは、ErrorEvent コンストラクタの text パラメータで定義します。
| メソッド | 定義元 | ||
|---|---|---|---|
|
エラーイベントに関する情報を含む Event オブジェクトを作成します。
| ErrorEvent | ||
|
ErrorEvent オブジェクトのコピーを作成して、各プロパティの値を元のプロパティの値と一致するように設定します。
| ErrorEvent | ||
![]() |
カスタム Event クラスに toString() メソッドを実装するためのユーティリティ関数です。
| Event | |
![]() |
オブジェクトに指定されたプロパティが定義されているかどうかを示します。
| Object | |
![]() |
イベントで preventDefault() が呼び出されたかどうかを確認します。
| Event | |
![]() |
Object クラスのインスタンスが、パラメータとして指定されたオブジェクトのプロトタイプチェーン内にあるかどうかを示します。
| Object | |
![]() |
イベントのデフォルトの動作をキャンセルできる場合に、その動作をキャンセルします。
| Event | |
![]() |
指定されたプロパティが存在し列挙できるかどうかを示します。
| Object | |
![]() |
ループ処理に対するダイナミックプロパティの可用性を設定します。
| Object | |
![]() |
イベントフローの現在のノードおよび後続するノードで、イベントリスナーが処理されないようにします。
| Event | |
![]() |
イベントフローの現在のノードに後続するノードで、イベントリスナーが処理されないようにします。
| Event | |
|
ErrorEvent オブジェクトのすべてのプロパティを含むストリングを返します。
| ErrorEvent | ||
![]() |
指定されたオブジェクトのプリミティブな値を返します。
| Object | |
| 定数 | 定義元 | ||
|---|---|---|---|
![]() | ACTIVATE : String = "activate" [static]
activate イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | ADDED : String = "added" [static]
added イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | ADDED_TO_STAGE : String = "addedToStage" [static]
addedToStage イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | CANCEL : String = "cancel" [static]
cancel イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | CHANGE : String = "change" [static]
change イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | CLOSE : String = "close" [static]
close イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | COMPLETE : String = "complete" [static]
complete イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | CONNECT : String = "connect" [static]
connect イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | DEACTIVATE : String = "deactivate" [static]
deactivate イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | ENTER_FRAME : String = "enterFrame" [static]
enterFrame イベントオブジェクトの type プロパティ値を定義します。
| Event | |
| ERROR : String = "error" [static]
error イベントオブジェクトの type プロパティ値を定義します。
| ErrorEvent | ||
![]() | FULLSCREEN : String = "fullScreen" [static]
fullScreen イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | ID3 : String = "id3" [static]
id3 イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | INIT : String = "init" [static]
init イベントオブジェクトの type プロパティの値を定義します。
| Event | |
![]() | LINK : String = "link" [static]
link イベントオブジェクトの type プロパティ値を定義します。
| TextEvent | |
![]() | MOUSE_LEAVE : String = "mouseLeave" [static]
mouseLeave イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | OPEN : String = "open" [static]
open イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | REMOVED : String = "removed" [static]
removed イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | REMOVED_FROM_STAGE : String = "removedFromStage" [static]
removedFromStage イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | RENDER : String = "render" [static]
render イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | RESIZE : String = "resize" [static]
resize イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | SCROLL : String = "scroll" [static]
scroll イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | SELECT : String = "select" [static]
select イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | SOUND_COMPLETE : String = "soundComplete" [static]
soundComplete イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | TAB_CHILDREN_CHANGE : String = "tabChildrenChange" [static]
tabChildrenChange イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | TAB_ENABLED_CHANGE : String = "tabEnabledChange" [static]
tabEnabledChange イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | TAB_INDEX_CHANGE : String = "tabIndexChange" [static]
tabIndexChange イベントオブジェクトの type プロパティ値を定義します。
| Event | |
![]() | TEXT_INPUT : String = "textInput" [static]
textInput イベントオブジェクトの type プロパティ値を定義します。
| TextEvent | |
![]() | UNLOAD : String = "unload" [static]
unload イベントオブジェクトの type プロパティ値を定義します。
| Event | |
| ErrorEvent | () | コンストラクタ |
public function ErrorEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, text:String = "")
| 言語バージョン : | ActionScript 3.0 |
| Player のバージョン : | Flash Player 9 |
エラーイベントに関する情報を含む Event オブジェクトを作成します。イベントリスナーには Event オブジェクトがパラメータとして渡されます。
パラメータtype:String — イベントのタイプです。イベントリスナーは、継承された type プロパティを通じてこの情報にアクセスできます。エラーイベントのタイプは、ErrorEvent.ERROR のみです。
|
|
bubbles:Boolean (default = false) — Event オブジェクトでバブリングを実行できるかどうかを判断します。イベントリスナーは、継承された bubbles プロパティを通じてこの情報にアクセスできます。
|
|
cancelable:Boolean (default = false) — Event オブジェクトがキャンセル可能かどうかを判断します。イベントリスナーは、継承された cancelable プロパティを通じてこの情報にアクセスできます。
|
|
text:String (default = "") — エラーメッセージとして表示されるテキストです。イベントリスナーは、text プロパティを通じてこの情報にアクセスできます。
|
| clone | () | メソッド |
public override function clone():Event
| 言語バージョン : | ActionScript 3.0 |
| Player のバージョン : | Flash Player 9 |
ErrorEvent オブジェクトのコピーを作成して、各プロパティの値を元のプロパティの値と一致するように設定します。
戻り値Event — 元のオブジェクトと同じプロパティ値を含む新しい ErrorEvent オブジェクトです。
|
| toString | () | メソッド |
public override function toString():String
| 言語バージョン : | ActionScript 3.0 |
| Player のバージョン : | Flash Player 9 |
ErrorEvent オブジェクトのすべてのプロパティを含むストリングを返します。ストリングは次の形式です。
[ErrorEvent type=value bubbles=value cancelable=value text=value]
String — ErrorEvent オブジェクトのすべてのプロパティを含むストリングです。
|
| ERROR | 定数 |
public static const ERROR:String = "error"
| 言語バージョン : | ActionScript 3.0 |
| Player のバージョン : | Flash Player 9 |
type プロパティ (error イベントオブジェクト) の値を定義します。
このイベントには、次のプロパティがあります。
| プロパティ | 値 |
|---|---|
bubbles | false |
cancelable | false は、キャンセルするデフォルトの動作がないことを示します。 |
currentTarget | イベントリスナーで Event オブジェクトをアクティブに処理しているオブジェクトです。 |
target | ネットワーク操作エラーが発生したオブジェクトです。 |
text | エラーメッセージとして表示されるテキストです。 |
errorHandler()) の使用方法を示します。ioError イベントがある場合、ハンドラはネットワークからロードしようとして、securityError をスローします。
メモ :MissingFile.xml という名前のファイルが SWF ファイルと同じディレクトリにある場合、この例は機能しません。
package {
import flash.display.Sprite;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.*;
public class ErrorEventExample extends Sprite {
private var loader:URLLoader;
private var request:URLRequest;
public function ErrorEventExample() {
loader = new URLLoader();
loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
request = new URLRequest();
loadFromFileSystem();
}
private function loadFromFileSystem():void {
request.url = "MissingFile.xml";
loader.load(request);
}
private function loadFromNetwork():void {
request.url = "http://www.[yourDomain].com/MissingFile.xml";
loader.load(request);
}
private function errorHandler(event:ErrorEvent):void {
trace("errorHandler: " + event);
if(event is IOErrorEvent) {
loadFromNetwork();
}
}
}
}
このページに新しいコメントが追加された場合に、電子メールでの通知を希望する。 | コメントレポート
現在のページ: http://livedocs.adobe.com/flash/9.0_jp/ActionScriptLangRefV3/flash/events/ErrorEvent.html