
490Debugging
When you launch your application using the Debug but-
ton (see figure 23.2), all network traffic appears in the
Console view.
This feature is considered anemic and underpowered.
Fortunately, a number of third-party tools do an amazing
job of speeding up the debugging process:
■
ServiceCapture—One of the best tools out there.
Not only does it understand Flash’s native
AMF Remote object protocol, but it
deciphers web service
SOAP and JSON-RPC. Its interactive nature lets you see
what parameters were passed to remote functions and what the data looked like
coming back in real time. Price: $35
U.S. http://kevinlangdon.com/serviceCap-
ture/.
■
Charles Web Debugging Proxy (CWDP)—A well-polished product loaded with fea-
tures. It provides protocol support similar to ServiceCapture, but it also does
bandwidth throttling to simulate network connection speed, and you can
export the results to a
CSV file. It’s available on multiple platforms but requires
the Sun Java
JDK to be installed. Price: $50 U.S. http://xk72.com/charles/
index.php.
Moving onto the heavyweight tool of debugging, let’s look at the Debugger that comes
with Flex Builder, a feature that came to maturity with Flex 3.
23.1.8 Using the Debugger
If you’ve reached a point where you need to see how things are changing and you also
need fine-grained control, the Debugger is the way to go. It helps you isolate where
issues are by allowing you to step through your code in a controlled manner and see
how variables change as the code executes.
The tool works by launching in Debug mode, setting breakpoints to pause execu-
tion, then adding variables to watch.
LAUNCHING DEBUG MODE
Enabling the Debugger is similar to how you’ve been launching your applications thus
far, except in this case you use the Debug button (refer back to figure 23.2).
Notice that along with the bin folder, there’s also bin-debug—this is the folder to
which Flex Builder publishes a debug version of your application. When you click the
Debug button, this version is launched.
If Flex Builder hasn’t done so already, switch to the Debug perspective in Flex
Builder by choosing Window > Perspective > Flex Debugging. You’ll see a number of
views, including the following:
■
Debug —Where you are in the application
■
Variables —An area where you can watch the values of all the variables Flex is
managing
Figure 23.2 You'll find the
Debug button on the Flex
Builder toolbar.
Kommentare zu diesen Handbüchern