MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Guía de usuario Pagina 200

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 256
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 199
200 Debug an Application
Set a breakpoint
To debug the problem, you can set a breakpoint on the line of code to suspend the application
so that you can inspect the function. Hitting a breakpoint activates the debugging perspective.
1. In the code editor, locate the line of code that contains the Button control. You’ll see that
the Button control’s Click event is bound to the
calculate function. Since this is where
the function is called, this is where you set the breakpoint.
2. Set a breakpoint on the line that contains the Click event handler by right-clicking
(Control-click on Macintosh) in the left margin of the code editor. Select Toggle
Breakpoint from the context menu and a breakpoint marker is added to the margin, as
shown here:
3. Save the file and you’re ready to debug the application.
NOTE
When setting breakpoints in MXML it’s important to understand that when you set a
breakpoint on a line it is set for all elements of the line. If you set a breakpoint on this
line and then run the application, the breakpoint will be activated as soon as the
Button control is drawn on the screen, rather than when it is clicked. To work around
this, you need to format your MXML to place a component’s attributes on separate
lines, as shown here:
<mx:Button
id="btn_calculate"
click="calculate();"
x="95"
y="140"
label="Calculate"
width="100"/>
Vista de pagina 199
1 2 ... 195 196 197 198 199 200 201 202 203 204 205 ... 255 256

Comentarios a estos manuales

Sin comentarios