Have you ever tried to manually launch a debug.swf in your browser and got the “connect to debugger where? localHost or remote” dialog box?.
Here is a scenario:
You have a flex application that has some service deployment dependencies on the server it is deployed on. In plain English this means that in order for your application to work, it has to be on a server with specific technologies such as (dot)NET. Well normally you would set up the deployment location in the “flex build path” and “flex server” tabs under the project’s properties. Sometimes that won’t do. What if you are working remotely? What if you VPN is extremely slow? What if the FileSync plug-in just takes too damn long to sync ONE file. This is my setup in a nutshell for the current project I am on (which I telecommute and use a high-encryption VPN client). In fact to deploy to a dev server takes me over 5 minutes for one build. Why? That is a topic still being investigated currently as I write this.
So rather than have to do a lengthy build, I can build to my local bin folder (which takes about 10 seconds), copy over to the the dev server folder manually using the old ctrl-c, ctrl-p method, and then launch the debugger version’s URL manually.
- Edit the “Output folder URL” under the “flex build path” tab in the project’s properties. I used http://www.google.com since about:blank doesn’t seem to work.
- Keep the”Output folder” the same as you would normally have it.
- Do a build of the debugger version.
- It will then try to launch the browser to the url specified in step 1. This will say it can’t find that file.
- Copy and Paste the version of the debug.swf where you want it to launch from on the remote location (hopefully taking only a few seconds at most).
- Launch the correct URL pointing to the debug.swf now deployed in the right place.
This works because the Flex Builder debugger retains its connection for about 2 minutes after you build a debug.swf. So by launching the fake location, you open the socket, then you can connect a remotely deployed debug.swf up to the debugger.
Thanks goes to Mike Morearty at Adobe for the inside tip. I think this will help alot of folks. You can read the original dialog I had with Mike (and read my idiotic reply, wtf justin, must have been tired or lazy or both?) at flex coders on a related post.