3 Replies Latest reply on Jun 10, 2006 1:18 AM by coolshare

    Failed to connect...

    coolshare Level 1
      I tried to debug my flex app and got a "Failed to connect...". I was asked to ensure

      1. Compile the app with debugging on

      What does that mean?

      I couldn't find any debugging enable check box or so in the compiling option setting...

      I also got a popup dlg asking "Where is the Debugger or Profiler running?"

      I selected "Locatlhost" but the dlg box appear again and again after clicking at "OK".

      Any suggestion?

      I have Flex Builder 2 beta 3.

      thanks
        • 1. Re: Failed to connect...
          Level 7
          From these symptoms, it sounds like for some reason Flex Builder and the
          Flash Player were not able to establish a connection with each other.

          The first point, "Compile the app with debugging on," you don't need to worry
          about: when compiling inside the Flex Builder environment, we automatically
          create two SWFs, <YourProject>.swf and <YourProject>-debug.swf. If you were
          doing a command-line compile with mxmlc, this message means to make sure you
          use the "-debug" option. But don't worry about that.

          The popup message from the player means that the player has correctly detected
          that you are trying to run a debuggable SWF, so it tried to connect to Flex
          Builder, but wasn't able to; so, it is asking you what machine the Flex
          Builder debugger is on.

          The way it is supposed to work is like this:

          1. You click Debug.
          2. Flex Builder starts listening on a particular TCP/IP socket.
          3. Flex Builder launches the Flash Player.
          4. The Flash Player loads the SWF and sees that that SWF is marked as a
          debuggable SWF.
          5. The Flash Player tries to connect to Flex Builder, on the same socket given
          in step 2.
          6. Now Flex Builder and the Flash Player are talking, and debugging begins.

          If step 5 doesn't happen -- the Flash Player tries to connect to Flex Builder,
          but for some reason can't connect to that socket -- then the Flash Player
          displays the "Where is the debugger" message you described.

          And meanwhile, over in Flex Builder, it listens on the socket for a total of
          two minutes. If no debugger connects during that time, then it displays the
          "timed out" message along with a few suggestions of what might have gone wrong.

          In your case, here are some possible causes of the problem:

          * One possibility is that there was a two-minute lag between when you clicked
          the Debug button in Flex Builder, and when you actually reached the page of
          your app that had the Flash app on it. E.g. did you customize your launch URL
          to point to some other page on your web server, and then from there click a
          few links or something to get to the page with the Flash app? If you take
          more than two minutes to go through that, then Flex Builder gives up waiting
          for the Flash player, and you will see the problem you described.

          * Maybe some strange networking issue on your machine. The Flash Player and
          Flex Builder communicate with each other via a TCP/IP socket. Maybe there is
          some sort of firewall on your machine that prevents connections even from
          another "localhost" program -- but that seems unlikely to me.

          I'm trying to think what else might have gone wrong, and am kind of stumped.
          Let me know if you still can't work it out.

          --
          Mike Morearty
          Developer, Flex Builder team
          http://www.morearty.com/blog
          • 2. Re: Failed to connect...
            ur_dtrain Level 1
            Mike,
            This happens to me every time I refresh the browser during 'debug' mode (which I use religiously). That whole prompt of use local or specify is totally useless - it doesn't work for any choice and should be eliminated, or there should be some documentation. This thing seems like and artifact of 1.~.
            • 3. Re: Failed to connect...
              coolshare Level 1
              Mike, your suggestion is really helpful: I got it - it was my ZoneAlarm.

              thanks

              mark