A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: LocalConnection Problem

  1. #1
    Member
    Join Date
    May 2005
    Location
    San Francisco
    Posts
    55

    LocalConnection Problem

    Hello,
    I have a projectthat relies heavily on LocalConnection to keep swfs communication with the master swf. Recently, i've been getting the following error at various points in the project:

    Code:

    Error #2044: Unhandled StatusEvent:. level=error, code=

    It seems to happen more often on page refresh, instead of on the initial page load. But it's not consistent. It does happen on page initialization sometimes as well.

    Anyone know what this means? It locks up my entire desktop for flash. If i try and even browse to another flash site after this, the plug in stalls out. The only solution is for me to reboot my system.

  2. #2
    Member
    Join Date
    May 2005
    Location
    San Francisco
    Posts
    55
    Ahh i finally figured it out. Whenever you attempt to send data using LocalConnection, you need to ensure you have an event listener to handle any errors, especially if there's a chance the other connections have yet to open.

    i simply added

    Code:
    myOutboundConnection.addEventListener(StatusEvent.STATUS, onStatus);
    
    private function onStatus(event:StatusEvent):void {
                   {
                       switch (event.level) {
                           case "status":
                           trace("One of your LocalConnection variables was 
    able to connect");
                           break;
                           case "error":
                              trace("One of your LocalConnection variables 
    FAILED to connect");
                           break;
                       }
                   }
             }

  3. #3
    Junior Member
    Join Date
    Jun 2011
    Posts
    2

    What if not in class.

    Hello paragnoc,

    I have been searching for so long trying to find a solution to this same problem. However I'm not using a class just regular AS3 inside my swf.

    Could you possibly help me with how I would enter that same code into regular as3?

    I know this was posted a while ago but just hopeful questioning, thanks so much if you can help at all!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center