Debugging Applications running within Central

Because applications running within Central use the Central API and because those APIs are not available within the Flash Authoring environment, you have to test and debug your applications within Central itself. This is actually pretty simple, and you can use the trace() statement like your normally would.

There are two main steps to testing and debugging within the Central environment. The first is publishing a new SWF directly into Central. This is possible once you have installed your application into Central. The second is viewing runtime debug / trace information from the application.

Publishing directly into the Central Environment:

  1. Find the location where you application files were installed by Central. On Windows this willbe similar to: C:\Documents and Settings\USERNAME\ApplicationData\Macromedia\Central\DOMAINNAME\APPNAME . On Mac, this will be similar to:Hard Drive/Users/USERNAME/Library/Application Support/Macromedia/Central/DOMAINNAME/APPNAME/
  2. Open your application within the Flash Authoring Environment.
  3. Open the Publish Settings Dialog (File > Publish Settings).
  4. Set the file to Publish into the directory located above. Make sure that the file is published withthe same file name that was installed by Central.
  5. Save the settings, by clicking OK.

To test your application, you must publish it (File > Publish). This will compile the SWF into itsapplication directory within Central. You can then view the updated application file by switchingto Central and reloading the application by switching to another application within Central andthen switching back. If you are testing a Pod, you must close the pod and reopen it. If you aretesting an Agent, you must restart Central.

Once the application is running within the Central environment, you can use the Central DebugPanel to view runtime debug information from the application. The Central Debug Panel runswithin the Flash Authoring environment, and can be installed from the SDK.

To install the Central Debug Panel:

  1. Make sure you have the Macromedia Extension Manager installed. You can download theExtension Manager from here.
  2. Locate the CentralDebug.mxp file in the Utilities\DebugPanel subdirectory under the SDKdirectory.
  3. Open the CentralDebug.mxp file in the Macromedia Exchange Manager to install the panelautomatically in the Macromedia Flash authoring tool.

Using the Debug Panel:

  1. Open the debug panel in the Flash Authoring Environment. In Flash MX it is located in theWindows > Central Debug Panel menu. In Flash MX 2004 it can be located in the Windows> Other Panels > Central Debug Panel.
  2. Make sure that �Omit trace actions� is not checked in the public settings (File > Publish Settings> Flash).
  3. Add debug.enabled = true; to your application. This will enabled debugging.
  4. Add trace statements to your application. You can pass in various data types including strings,objects and arrays.
  5. Test your application within Central. Any trace statements encounter during the application�sruntime will be printed out into the Debug Panel within the Flash Authoring Environment.

Here is an example onActivate method:

[code]onActivate = function(shell, appId, shellId, baseTabIndex, initialData){debug.enabled = true;trace(“onActivate”);trace(“baseTabIndex : ” + baseTabIndex);}[/code]

Here is what gets printed to the debug panel:


Note, the Central Debug Panel on the SDK is a beta version. If it doesn’t appear to be working, you may have to close and then reopen it.

3 Responses to Debugging Applications running within Central

  1. cub says:

    I can’t seem to find where to set an alternate export destination in the Publish Settings. I am using Flash MX on Mac OS X. Is this a F04 only thing?

  2. Daniel Dura says:

    In F04 you can use the typical browse button, but in Flash MX, you need to put the entire path into the output field manually.

  3. cub says:

    My brain wasn’t working, I’m so used to using slashes for my paths and that didn’t work so I assumed that I was missing something. So the example Mac path from above to use in Flash MX would be:Hard Drive:Users:USERNAME:Library:Application Support:Macromedia:Central:DOMAINNAME:APPNAME: