New Developer Tools for the Editor
As Sharendipity continues to mature, we are beginning to add more advanced features to the editor that can aid the developer in building his or her application in a significant way.
Traditional programmers using professional development environments are used to having certain tools available to help them troubleshoot their applications. Creators in Sharendipity, including our non-programmers, also require methods for debugging problems and tracking down performance issues. This post highlights a few of the features we’ve added that will help improve your development experience.
If you have any feedback about how we can continue to improve the tools please let us know. We’re always listening.
The Console Window and Trace Statements
One of the more basic troubleshooting tools developers use is a console window that provides a simple way to display arbitrary information about the program. Sharendipity now has a Console Window that can receive text output from an application. The console can be accessed through the Director menu:
This will bring up the console window, shown here with output from the Teslaformer game:

You can display text on the console window using the “trace” action available in any Behavior or Method of a class in Sharendipity. The trace statement can also take just about any type. You can even concatenate values together using the “+” operator as shown here:

The console can be useful for monitoring all kinds of activity within an application. For example, you can print messages to the console simply to let you know when a particular behavior is running, or you can print out individual property values as they are changing.
The Problem Viewer
The Problem Viewer is a dialog that displays logic errors to the developer that prevent the application from running correctly. When there is a problem in an application, a red notifier saying “Problems” will appear in the top-left corner of the editor. Clicking on this will bring up the Problem Viewer dialog.
The viewer displays basic logic errors that prevent applications from starting (e.g. forgetting to assign a value in a property set action) as well as errors that occur while the application is running (e.g. your logic is expecting objects to be present and they aren’t).
Double-clicking on an item in the Problem Viewer will take you directly to the location of the problem. You don’t need to go searching around for the location of the error.
Below is a view of the Problem Viewer in an application I set up to be broken intentionally. You can see that there are a lot of issues and the Problem Viewer allows me to see exactly which classes and methods they’re coming from.

The Profiler
The Sharendipity editor also includes some new functionality that lets you analyze which parts of your application are taking longer to execute. Similar to the Console Window, the profiler can be accessed from the Director menu:
Clicking on “Performance…” in the director menu will bring up the Performance Management dialog, which looks like this:

In this view, Profiling has already been enabled and data is being collected in the running application. From the menu you can view the current profiling data, and you can also clear the profiling data. Viewing the profiling data will give you a view similar to this:

Similar to the Problem Viewer, double-clicking on one of the rows in the Profiler will allow you to see exactly which calls are taking all of the time, including breakdowns by constructs such as “if” statements:

Breakpoints
Like most debugging tools, Sharendipity also offers a way to halt execution of a thread to examine the current variable data. The current implementation uses a “Breakpoint” statement. Under the hood, this throws an exception that will show up in the Problem Viewer, preventing following statements in the behavior or method from running. Opening the problem viewer and double-clicking on the Breakpoint exception will bring you to the Behavior or Method where the breakpoint was hit.
The really handy part is that now you can mouse over variables in the Method Builder or Behavior Builder to see their values:

The Sharendipity Wiki
I’ll also take a second to mention that a lot of information is documented over at the Sharendipity wiki. If you happen to get stuck, this is a great place to start. There are also forums there that allow you to ask questions about any of the topics on the wiki and we’ll respond as soon as we can.
The Complete Picture
With the addition of these new developer tools, the platform is really starting to display its true potential. Not only is Sharendipity a complete authoring environment for Flash games and applications, it provides distribution as well as monetization opportunities for the developer, all built on a platform designed for sharing and extensibility.
Tags:breakpoints, creation, debugging, game, performance, profile
6. August 2009 at 10:18 am :
Keep the articles coming! You guys are amazing!
2. October 2009 at 11:13 am :
[...] also recently released developer tools including a profiler for optimizing application [...]