Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

6: Debugging Applications > HANDLING UNCAUGHT ERRORS

HANDLING UNCAUGHT ERRORS

So far you have learned how to set breakpoints, and how to read variables during the debugging session. Now take a look at handling the error introduced to the project using Watch expressions.

image Handling Uncaught Errors

The following steps will take you through handling the error introduced in the Debugging App project using the UncaughtErrorEvent class.

  1. Return to the Flash Perspective in the Debugging App project. In DebuggingApp.mxml, add a protected function called onAppComplete(), and then assign the function to the applicationComplete property in the attributes for opening the <s:ViewNavigatorApplication> tag (Listing 6-4).

    image

    LISTING 6.4: Adding the onAppComplete() method to the <fx:Script> declaration in DebuggingApp.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                xmlns:s="library://ns.adobe.com/flex/spark"
                                firstView="views.DebuggingAppHome"
                                applicationComplete=“onAppComplete()”>
    
          <fx:Script>
                <![CDATA[
    
                      protected function onAppComplete():void {}
    
                ]]>
          </fx:Script>
    
    </s:ViewNavigatorApplication>

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint