views:

36

answers:

2

Hi Flash experts!

I have a Flex 4 application which connects to ASP.NET webservice based on FluorineFx. It is authenticated by cookies via RemoteObject.setCreadentials()

Both applications connect to FMS server and talks to each other via RTMFP direct connection (P2P).

I want to debug both instances of this application in Firefox and Internet Explorer at one time by single click (F11).

Now I can debug only in one browser by running Debug in Flash Builder 4. I have created double browser runner with bat file registered as default browser in Preferences > General > Web browser that looks like this:

start "IE" /b "c:\Program Files (x86)\Internet Explorer\iexplore.exe" -private %1
start "FF" /b "c:\Program Files (x86)\Mozilla Firefox\firefox.exe" -private %1

But this connects the debugger only to firstly run instance of the application in Internet Explorer.

How can I attach to and debug both instances?

Thanks.

A: 

I never tried it, but what I'm guessing is, that you have to run a second Flash Builder instance and attach the debugger to the second application instance. The article "FlexBuilder 3 Attach to Running Process to Debug" might be helpful in this case.

splash
In fact, you can run two debugger attached instances in one Flash Builder, but you need to run Debug, than switch default browser and run Debug for second browser. Flash Builder debugger stays connected to both of them. But this is a long process for my taste.
Tomas Mirezko
@Tomas, so if your solution is not satisfying you, then you could try my suggested "Second Flash Builder instance" approach. The second instance could be preconfigured for debugging, link to the same sources and maybe it's just a single click to attach ... :-)
splash
I couldn't start two instances of Flash Builder for single workspace, so I've created a BAT file (see below).
Tomas Mirezko
@Tomas, if the Eclipse workspace `.lock` file is the problem, then you should link (`mklink`) your project folder to the *different* workspace folder of your second Flash Builder instance.
splash
+2  A: 

Ok, solution found. Not exactly running by single click, but two clicks, but still it is better than changing default browser twice for every Debug session.

Place this code into a bat or cmd file and assign as a default browser (Preferences > General > Web browser, New...)

@echo off
IF EXIST ff.lock GOTO runie
IF NOT EXIST ff.lock GOTO runff
:runie
START "IE" /b "c:\Program Files (x86)\Internet Explorer\iexplore.exe" -private %1
DEL ff.lock
GOTO end
:runff
START "FF" /b "c:\Program Files (x86)\Mozilla Firefox\firefox.exe" -private %1
ECHO lock > ff.lock
GOTO end
:end

... and click Debug, twice! It starts two browsers and attaches debugger to both of them!

Note: If you are running Windows Vista/7 with UAC enabled, you may have to start Flash Builder as an administrator (to allow the script file write to ff.lock file).

Tomas Mirezko
@Tomas, Good work!
splash