Sunday, June 29, 2008

Two Tips For Debugging Flash Warnings

If you develop Flash widgets or application you might (and should) be familiar with the flash log.
One of the biggest issues with this log is that all the warnings and trace messages just pile up there regardless of what swf sent them.

Here are two simple tips to trace the "Warning: name is not a function" messages:

1. The reason you get those is because you are trying to call a function on some variable does not have such a function in its prototype chain.

2. To be able to identify what line in your code is causing those messages you can force the player to write out "Comments" into the log using the following syntax:

  ({}).THIS_IS_A_COMMENT_TO_THE_LOG()

This will trigget the same type of warning and so by placing several distinct such comments you can narrow the search and find the code line at fault.

No comments:

 
Clicky Web Analytics