We started using Flex in our project and as you know able to debug in real time is just a great convenience a developer can have at his disposal. Flex Builder itself is just good enough for debugging a Flex application, but when you have to do remote debugging Flex Builder does not seem to have an option as one of the Debug configuration.
The idea is that you build your application using ANT as a WAR file and your flex application is part of it and we want to figure out how to debug the deployed WAR.
I did some research and this is what we need to do.......
1) First is to update your mxmlc task to produce a compiled debug version of your application. Just add the following option inside the mxmlc tag
compiler.debug = true.
2) Next is to generate a HTML Wrapper for the SWF file to be embedded into......
For that add a html-wrapper task....refer the livedocs for the options.....
3) You need a debug version of the flash player specific to the browser on which you run the application.
These two things set, we next need to figure out how to do remote debugging.....
For that you need to create a debug configuration.......under Flex Web Application....
Select the flex project(I have it as a separate project in Flex Builder)
Select the Application file, the one which has the
Uncheck Use Default option and use a URL like this......
http://localhost:7001/projectname/MainApplication.html
The MainApplication.html is the html wrapper for the swf(MainApplication.swf) you generated using the Ant Task.
Thats it.......
Also you will be able to swing between the Java and Actionscript fucntions as they are called if you use the Flex Builder with Java Support or if you use Eclipse and have flex builder as a plugin.
Just check the live docs if you have any trouble using any of the above options....
2 comments:
The next thing is to figure out how to pass flashVars to the embedded swf file. The idea is that your application may need some initial data to get along. If you edit the generate html template you can pass in using flashVars option and/or add the param tag with flashVars as key and list of values as the value.But if you build your application using Ant, the html template would be overriden each time its generated. To avoid this we need to pass flashVars during the html-wrapper generation probably in the html-wrapper task.
Researching on this.....
Good point, though sometimes it's hard to arrive to definite conclusions
Post a Comment