O'Reilly logo

Learning Flex 4 by Elijah Robison, Alaric Cole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Debugging Flex Applications

IN THIS CHAPTER

Outputting Values to the Console Using trace()

Inspecting Event Properties with trace()

Using Breakpoints

Summary

Butch Cassidy: “I’ll jump first.” Sundance Kid: “Nope.” Butch Cassidy: “Then you jump first.” Sundance Kid: “No, I said!” Butch Cassidy: “What’s the matter with you?!” Sundance Kid: “I can’t swim!” Butch Cassidy: “Why, you crazy...the fall will probably kill ya!”

Paul Newman Robert Redford Butch Cassidy and the Sundance Kid

By now, you’re probably comfortable enough with Flex basics to have created a few experimental interfaces. To be a real code mechanic, though, you also need some techniques to inspect what’s happening under the hood. It’s called debugging. No doubt you’ve heard the term before, and your first impressions are probably close enough. Debugging is troubleshooting, and troubleshooting is tedious.

Fortunately Flash Builder includes some tools to simplify your debugging routines, and this chapter teaches you how to use them. We’ll discuss use of the trace() statement to preview variable values, how to pause and inspect code logic using breakpoints, and how to benefit from Flash Builder’s Debugging perspective.

The goal of debugging is testing variables and functions to ensure they result in the values you expected when you first created them. By its very name, debugging implies that there’s a bug—or glitch—in your software that you need to locate. As you’ll see, however, there’s more to debugging than that. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required