View comments | RSS feed

Server-side information objects overview

The Application, NetConnection, and Stream classes 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(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.


Comments


Greg_Hamer said on Oct 4, 2004 at 9:28 PM :
Typo. function showStatusForClass() missing 1 closing brace. (Currently 3 opening; only 2 closing. As is throws error viewable in Communication App Inspector "Live Log" window.)

Should be:

function showStatusForClass(){
for (var i=0;i<arguments.length;i++){
arguments[i].prototype.onStatus = function(infoObj){
trace(infoObj.code + " (level:" + infoObj.level + ")");
}
}
}
showStatusForClass(NetConnection, Stream);
Stephanie G said on Oct 8, 2004 at 8:58 AM :
Thank you for calling the code error to our attention. We'll file a documenation bug and correct the code for the next doc release.
Stephanie G said on Oct 8, 2004 at 9:01 AM :
Oops. Make that "documentation" bug. Geesh. :-)

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flashcom/mx2004/main/00000516.html