• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Appendix: IV Appendixes: Quick Reference... > onStatus Catch-All Template (SSAS an...

onStatus Catch-All Template (SSAS and Flash)

Use this script to overwrite all onStatus function prototypes. By including this script template, you will not be required to define any onStatus events. This is an excellent tool for debugging.

Listing E.5. onStatus (Catch-All) ActionScript Template

function onStatusTemplate(info) {
      infoMessage_array = info.code.split(“.”);
      trace(“ ** Status Message Received for: “+infoMessage_array[0]+” **”);
      trace(“ ** “+new Date());
      trace(“    |::: Level—> “+info.level);
      trace(“    |::: Code —> “+info.code);
      // Trace extra Information properties
      if (info.description != undefined) {
            trace(“    |::: Description—> “+info.description);
      }
      if (info.details != undefined) {
            trace(“    |::: Details—> “+info.details);
      }
      if (info.application != undefined) {
            trace(“    |::: Application—> “+info.application);
      }
      switch (infoMessage_array[0]) {
      case “Application” :
            trace(“    | ::::Application Messages”);
            // Display Script Error Messages
            if (infoMessage_array[1] == “script”) {
                  trace("    |::: Script Error Details.  Filename—> "+info.filename+"   Line—> "+info.lineno);
                  trace(info.linebuf);
            }
            // Place Code Here
            break;
      case “Camera” :
            //   | :::: Handle Camera Messages
            // Place Code Here
            break;
      case “Microphone” :
            //    | :::: Handle Microphone Messages
            // Place Code Here
            break;
      case “NetConnection” :
            //    | ::: Handle NetConnection Messages
            if (infoMessage_array[2] == “Success”) {
                  trace("    |::* Connection was Accepted by the Server , continuing to load!");
                  // Scripts to run when the Connection has succeeded
                  nc.call(“sayHelloServer”, new server_ret());
                  nc.call(“setConnectTimes”, new server_ret());
                  connectObjects();
                  streamIt();
            }
            // Place Code Here
            break;
      case “NetStream” :
            //    | :::: Handle NetStream Messages
            // Place Code Here
      }
      trace(“ ** End Status Message for: “+infoMessage_array[0]+” **”);
      trace(“”);
}


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint