📄 applicationerror.as
字号:
package com.example.programmingas3.errors
{
public class ApplicationError extends Error
{
internal static const WARNING:int = 0;
internal static const FATAL:int = 1;
public var id:int;
public var severity:int;
private static var messages:XML;
public function ApplicationError() {
messages = <errors>
<error code="9000"><![CDATA[Employee must be assigned to a cost center.]]></error>
<error code="9001"><![CDATA[Employee must be assigned to only one cost center.]]></error>
<error code="9002"><![CDATA[Employee must have one and only one SSN.]]></error>
<error code="9999"><![CDATA[The application has been stopped.]]></error>
</errors>;
}
public function getMessageText(id:int):String {
var message:XMLList = messages.error.(@code == id);
return message[0].text();
}
public function getTitle():String {
return "Error #" + id;
}
public function toString():String {
return "[APPLICATION ERROR #" + id + "] " + message;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -