flash.events
public class SecurityErrorEvent
继承SecurityErrorEvent Inheritance ErrorEvent Inheritance TextEvent Inheritance Event Inheritance Object

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9

出现安全错误时,Flash ® Player 将调度 SecurityErrorEvent 对象。 通过该类所报告的安全错误一般是由异步操作(例如加载数据)产生的,这种情况下安全侵犯可能不会被立即列出。 事件侦听器可以访问对象的 text 属性,以确定尝试过哪些操作以及涉及哪些 URL。 如果没有事件侦听器,Flash Player 的调试版将自动显示包含 text 属性内容的错误消息。 只有一种类型的安全错误事件:SecurityErrorEvent.SECURITY_ERROR

安全错误事件是针对任何目标对象进行调度的最终事件。 这意味着对于遇到安全错误的目标对象,不能调度任何其它事件(包括一般错误事件)。

查看示例

另请参见

Security class
SECURITY_ERROR
Flash Player 安全性



公共 属性
 属性定义方
 Inheritedbubbles : Boolean
[read-only] 指示事件是否为冒泡事件。
Event
 Inheritedcancelable : Boolean
[read-only] 指示是否可以阻止与事件相关联的行为。
Event
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
 InheritedcurrentTarget : Object
[read-only] 当前正在使用某个事件侦听器处理 Event 对象的对象。
Event
 InheritedeventPhase : uint
[read-only] 事件流中的当前阶段。
Event
 Inheritedprototype : Object
[static] 对类或函数对象的原型对象的引用。
Object
 Inheritedtarget : Object
[read-only] 事件目标。
Event
 Inheritedtext : String
在 textInput 事件中,由用户输入的字符或字符序列。
TextEvent
 Inheritedtype : String
[read-only] 事件的类型。
Event
公共 方法
 方法定义方
  
SecurityErrorEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, text:String = "")
创建一个 Event 对象,其中包含有关安全错误事件的信息。
SecurityErrorEvent
  
创建 SecurityErrorEvent 对象的副本,并设置每个属性的值以匹配原始属性值。
SecurityErrorEvent
 Inherited
formatToString(className:String, ... arguments):String
在自定义 Event 类中实现 toString() 方法的实用程序函数。
Event
 Inherited
指示对象是否已经定义了指定的属性。
Object
 Inherited
检查是否已对事件调用 preventDefault()。
Event
 Inherited
指示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
 Inherited
如果可以取消事件的默认行为,则取消该行为。
Event
 Inherited
指示指定的属性是否存在、是否可枚举。
Object
 Inherited
设置循环操作动态属性的可用性。
Object
 Inherited
防止对事件流中当前节点中和所有后续节点中的事件侦听器进行处理。
Event
 Inherited
防止对事件流中当前节点的后续节点中的所有事件侦听器进行处理。
Event
  
返回一个字符串,其中包含 SecurityErrorEvent 对象的所有属性。
SecurityErrorEvent
 Inherited
返回指定对象的原始值。
Object
公共 常量
 常量定义方
 InheritedACTIVATE : String = "activate"
[static] 定义 activate 事件对象的 type 属性值。
Event
 InheritedADDED : String = "added"
[static] 定义 added 事件对象的 type 属性值。
Event
 InheritedADDED_TO_STAGE : String = "addedToStage"
[static] 定义 addedToStage 事件对象的 type 属性值。
Event
 InheritedCANCEL : String = "cancel"
[static] 定义 cancel 事件对象的 type 属性值。
Event
 InheritedCHANGE : String = "change"
[static] 定义 change 事件对象的 type 属性值。
Event
 InheritedCLOSE : String = "close"
[static] 定义 close 事件对象的 type 属性值。
Event
 InheritedCOMPLETE : String = "complete"
[static] 定义 complete 事件对象的 type 属性值。
Event
 InheritedCONNECT : String = "connect"
[static] 定义 connect 事件对象的 type 属性值。
Event
 InheritedDEACTIVATE : String = "deactivate"
[static] 定义 deactivate 事件对象的 type 属性值。
Event
 InheritedENTER_FRAME : String = "enterFrame"
[static] 定义 enterFrame 事件对象的 type 属性值。
Event
 InheritedERROR : String = "error"
[static] 定义 error 事件对象的 type 属性值。
ErrorEvent
 InheritedFULLSCREEN : String = "fullScreen"
[static] 定义 fullScreen 事件对象的 type 属性值。
Event
 InheritedID3 : String = "id3"
[static] 定义 id3 事件对象的 type 属性值。
Event
 InheritedINIT : String = "init"
[static] 定义 init 事件对象的 type 属性值。
Event
 InheritedLINK : String = "link"
[static] 定义 link 事件对象的 type 属性值。
TextEvent
 InheritedMOUSE_LEAVE : String = "mouseLeave"
[static] 定义 mouseLeave 事件对象的 type 属性值。
Event
 InheritedOPEN : String = "open"
[static] 定义 open 事件对象的 type 属性值。
Event
 InheritedREMOVED : String = "removed"
[static] 定义 removed 事件对象的 type 属性值。
Event
 InheritedREMOVED_FROM_STAGE : String = "removedFromStage"
[static] 定义 removedFromStage 事件对象的 type 属性值。
Event
 InheritedRENDER : String = "render"
[static] 定义 render 事件对象的 type 属性值。
Event
 InheritedRESIZE : String = "resize"
[static] 定义 resize 事件对象的 type 属性值。
Event
 InheritedSCROLL : String = "scroll"
[static] 定义 scroll 事件对象的 type 属性值。
Event
  SECURITY_ERROR : String = "securityError"
[static] SecurityErrorEvent.SECURITY_ERROR 常量定义 securityError 事件对象的 type 属性值。
SecurityErrorEvent
 InheritedSELECT : String = "select"
[static] 定义 select 事件对象的 type 属性值。
Event
 InheritedSOUND_COMPLETE : String = "soundComplete"
[static] 定义 soundComplete 事件对象的 type 属性值。
Event
 InheritedTAB_CHILDREN_CHANGE : String = "tabChildrenChange"
[static] 定义 tabChildrenChange 事件对象的 type 属性值。
Event
 InheritedTAB_ENABLED_CHANGE : String = "tabEnabledChange"
[static] 定义 tabEnabledChange 事件对象的 type 属性值。
Event
 InheritedTAB_INDEX_CHANGE : String = "tabIndexChange"
[static] 定义 tabIndexChange 事件对象的 type 属性值。
Event
 InheritedTEXT_INPUT : String = "textInput"
[static] 定义 textInput 事件对象的 type 属性值。
TextEvent
 InheritedUNLOAD : String = "unload"
[static] 定义 unload 事件对象的 type 属性值。
Event
构造函数详细信息
SecurityErrorEvent()构造函数
public function SecurityErrorEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, text:String = "")

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9

创建一个 Event 对象,其中包含有关安全错误事件的信息。 将 Event 对象作为参数传递给事件侦听器。

参数
type:String — 事件的类型。事件侦听器可以通过继承的 type 属性访问此信息。 只有一种类型的 error 事件:SecurityErrorEvent.SECURITY_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

创建 SecurityErrorEvent 对象的副本,并设置每个属性的值以匹配原始属性值。

返回
Event — 其属性值与原始属性值匹配的新 securityErrorEvent 对象。

另请参见

toString()方法 
public override function toString():String

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9

返回一个字符串,其中包含 SecurityErrorEvent 对象的所有属性。 字符串的格式如下:

[securityErrorEvent type=value bubbles=value cancelable=value text=value]

返回
String — 一个字符串,其中包含 SecurityErrorEvent 对象的所有属性。

另请参见

常量详细信息
SECURITY_ERROR常量
public static const SECURITY_ERROR:String = "securityError"

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9

SecurityErrorEvent.SECURITY_ERROR 常量定义 securityError 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
currentTarget当前正在使用某个事件侦听器处理 Event 对象的对象。
target报告安全错误的网络对象。
text要显示为错误消息的文本。

另请参见

示例 如何使用示例

以下示例使用 SecurityErrorEventExample 类来说明如何实例化侦听器方法 securityErrorHandler() 并将其设置为侦听将要调度的 securityError 事件。 当 URLRequest 位置与调用 SWF 不完全属于同一个域,而且请求的域没有获得通过跨域策略文件进行跨域访问的授权时,会发生此事件。

若要创建 SecurityErrorEvent,请将 http://www.[yourdomain].com 替换为一个未获得跨域访问授权的路径。

package {
    import flash.display.Sprite;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.SecurityErrorEvent;

    public class SecurityErrorEventExample extends Sprite {
        public function SecurityErrorEventExample() {
            var loader:URLLoader = new URLLoader();
            loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);

            var request:URLRequest = new URLRequest("http://www.[yourDomain].com");
            loader.load(request);
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }
    }
}




 

评论添加到页面后给我发送电子邮件 | 评论报告

当前页: http://livedocs.adobe.com/flash/9.0_cn/ActionScriptLangRefV3/flash/events/SecurityErrorEvent.html