
67
APPENDIX
Server-Side Information Objects
The Application, NetConnection, and Stream objects provide an onStatus event handler that
uses an information object for providing information, status, or error messages. To respond to this
event handler, you must create a function to process the information object, and you must know
the format and contents of the information object returned.
You can define the following global function at the top of your main.asc file to display all the
status messages for the parameters that you pass to the function. You need to place this code in
the main.asc file only once.
function showStatusForClass(){
for (var i=0;i<arguments.length;i++){
arguments[i].prototype.onStatus = function(infoObj){
trace(infoObj.code + " (level:" + infoObj.level + ")");
}
}
showStatusForClass(Application, NetConnection, Stream)
For more information about information objects, see the appendix of the Client-Side
Communication ActionScript Dictionary.
An information object has the following properties:
level, code, description, and details.
All information objects have level and code properties, but only some have the description
and/or
details properties. The following tables list the code and level properties as well as the
meaning of each information object.
Application information objects
The following table lists the information objects for the Application object.
Code Level Meaning
Application.Script.Error Error The ActionScript engine has encountered a runtime error.
In addition to the standard infoObject properties, the
following properties are set:
filename: name of the offending ASC file.
lineno: line number where the error occurred.
linebuf: source code of the offending line.
Application.Script.Warning Warning The ActionScript engine has encountered a runtime warning.
In addition to the standard infoObject properties, the
following properties are set:
filename: name of the offending ASC file.
lineno: line number where the error occurred.
linebuf: source code of the offending line.
Komentáře k této Příručce