Skip navigation
theErez
Currently Being Moderated

LocalConnection works when it should fail

Apr 15, 2012 12:41 AM

Tags: #localconnection

Hi,

in my page i have a main swf, which should check the existence of a second swf - if its missing, the main swf should display a certain message to the user, otherwise it should work as planned.

i thought to achieve this by using LocalConnection - the main swf is set as the sending swf, and it should call a certain function on the other swf.  i was thinking that if the second swf is missing, the local connection would fail - either throw an error or its STATUS event listener would receive an 'error' message.

if you think as i did - well think again.  no error was thrown and the listener got a 'status' message, although there's nobody to handle the LocalConnection 'send' method.

 

what did i miss?  or is there a better way to achieve my goal?

cheers,

eRez

 
Replies
  • kglad
    72,220 posts
    Jul 21, 2002
    Currently Being Moderated
    Apr 15, 2012 7:19 AM   in reply to theErez

    show your localconnetion code (only) including your statusevent listener.

     
    |
    Mark as:
  • kglad
    72,220 posts
    Jul 21, 2002
    Currently Being Moderated
    Apr 15, 2012 1:04 PM   in reply to theErez

    use:

     

     

    protected function onEnterFrame(event:Event):void

            {

              removeEventListener(Event.ENTER_FRAME, onEnterFrame);

                  ...

              var conn:LocalConnection = new LocalConnection();

              conn.addEventListener(StatusEvent.STATUS,onLCStatus);

              //conn.connect("toolbarCheck");

              conn.send("toolbarCheck","checkForToolbar");

    }

     

    private function onLCStatus(event:StatusEvent):void

    {

          if (event.level == "error")

          {

              // display message

          }

          else

          {

             // keep on going...

          }

    }

     

     

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points