Flex 4.6  -- how to debug runtime errors

Posted on 2012-08-27
Last Modified: 2012-09-18
I'm teaching myself Adobe Flex 4.6 (FlashBuilder) and am picking up the coding method fine, but having trouble when I hit a runtime error.

For example, I have an app on a tabbed control that has a datagrid on each tab pulling MySQL data for display.  Rather than having all this code in the main file, I created separate components for each datagrid and dropped them into each tab.

Everything worked fine until I converted the last datagrid display into a component and put it on the top tab and removed the corresponding code in the main file.  That grid displays properly, but now when I click on any of the other tabs to show those grids I get the following runtime error:

ReferenceError: Error #1065: Variable _Componenets_teacherGridWatcherSetupUtil is not defined.
      at global/flash.utils::getDefinitionByName()
      at Componenets::teacherGrid()[C:\Users\Gary\Adobe Flash Builder 4.6\FlexPHPMysqlUpdateAdv\src\Componenets\teacherGrid.mxml:4]
      at mx.core::Container/createComponentFromDescriptor()[E:\dev\4.y\frameworks\projects\mx\src\mx\core\]
      at mx.core::Container/createComponentsFromDescriptors()[E:\dev\4.y\frameworks\projects\mx\src\mx\core\]
      at mx.core::Container/createDeferredContent()[E:\dev\4.y\frameworks\projects\mx\src\mx\core\]
      at mx.containers::ViewStack/instantiateSelectedChild()[E:\dev\4.y\frameworks\projects\mx\src\mx\containers\]
      at mx.containers::ViewStack/commitProperties()[E:\dev\4.y\frameworks\projects\mx\src\mx\containers\]
      at mx.containers::TabNavigator/commitProperties()[E:\dev\4.y\frameworks\projects\mx\src\mx\containers\]
      at mx.core::UIComponent/validateProperties()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\]
      at mx.managers::LayoutManager/validateProperties()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\]
      at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\]
      at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\]

Not sure how to begin debugging this and any help on this specific error, or on runtime debugging in Flex would be appreciated.


Question by:gdejarnett

    Author Comment

    Following up, I found that the problem was that I didn’t have the as3corelib in my build path.

    I'm not getting this error now, but if I could get some good advice on how to debug runtime errors here, I'll still award the points.

    Also if there are any Flashbuilder settings I should change (that are not already set by default) to avoid runtime errors, please let me know.


    LVL 12

    Accepted Solution

    I don't know if I'm being too obvious, so forgive me if I am, but have you tried using the Debug feature in Flash Builder?  It's whole purpose is to debug runtime errors, and drops into the Debug perspective whenever it encounters any, letting you see which line caused the problem and the values of any variables concerned. If the problem is in a library and it doesn't have access to the source then things are more complicated, but it's fine for your own code.

    To "avoid" runtime errors, you should wrap any code that's prone to throw runtime errors (IO, file, etc) in a try/catch block, and handle the problem properly rather than simply suppressing any errors.

    Author Closing Comment

    Thanks for the suggestion.

    Yes, I do use the debugger, but my problem is that when I would run it before deploying, it would run cleanly.

    I'll look more into the try/catch blocks though and see if I can bring it to the surface that way.

    Thanks again for taking the time to help,


    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
    We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now