Posts tagged "trick"

Debug Tricks: Remote Debug with Conditional Breakpoints

At some point, you’ve probably hit a bug that you can only reproduce on a remote machine (perhaps a testing/staging or production server). Here are some simple instructions on how to debug your SWF remotely:

  1. Open the Debug Configurations dialog. In the toolbar, click the Debug button and choose Other…. From the menu, choose Run > Debug > Other…
  2. Create a new Debug Configuration for your project. Click the new icon in the top left. Choose your project and the application MXML or ActionScript file.
  3. Specify the URL of your SWF or HTML file. Uncheck “Use Default” under “URL or path to launch”. Enter your URL.
  4. Debug

You can still use all the debug features you would normally use locally. A great trick to demo here is using conditional breakpoints to modify your application at runtime:

  1. Create a breakpoint
  2. Right click on the breakpoint, select Breakpoint Properties
  3. Check enable condition
  4. Enter a valid expression, e.g. this.mySprite.rotationZ += 10
  5. End the expression with: “, false”

Normally you would use conditional breakpoints to suspend when a condition is true. The trick here is that evaluating an expression can have intended/unintended side effects. In this case, we can string together a comma-separated list of expressions and never suspend the application since the expression will always return false.

Share on Facebook

Improving Compiler Performance for Large Projects

  1. Exit Flash Builder or Eclipse
  2. Open your FlashBuilder.ini or eclipse.ini file
    • Mac
      1. Right click on Adobe Flash Builder 4.app or Eclipse.app, Show Package Contents
      2. Open Contents > MacOS > Adobe Flash Builder 4.ini or eclipse.ini
    • Windows
      1. Open C:\Program Files\Adobe\Adobe Flash Builder 4\FlashBuilder.ini or <path to Eclipse>\eclipse.ini
  3. Find the maximum heap size setting, e.g. “-Xmx512m”
  4. Choose a new value for Xmx
  5. Save and restart Flash Builder or Eclipse
Share on Facebook

Flash Builder 4 Advanced Tips and Tricks on Adobe TV

In case you haven’t already seen this, Scott Evans’ MAX talk “Flash Builder 4 Advanced Tips and Tricks” is up on Adobe TV.

Share on Facebook

Patch for Snow Leopard line number scrolling bug

One of the most “popular” bugs in my bug queue has been FB-23023. Essentially, if you’re using Snow Leopard with Flash Builder and your window is on a secondary monitor, the line numbers in code editors stop scrolling. That’s a pretty annoying bug for someone who just bought a shiny new Macbook and hooked up an external monitor.
Luckily, the folks at Eclipse.org were able to narrow down the issue and referenced the fix that was applied for the future 3.6 release.
And to top it off, Rick Winscot went out of his way to build a patch that’s easily applied to standalone and plugin installations of Flash Builder. Thanks, Rick!
Update: To run Flash Builder with the -clean option, do the following:
  1. Open a terminal window
  2. Right click on “Adobe Flash Builder 4.app”, show package contents
  3. Expand Contents > MacOS
  4. Drag and drop “Adobe Flash Builder 4″ to the terminal window
  5. Add ” -clean”
  6. Run
Share on Facebook

Workaround for using the latest nightly SDK 4.0 builds with Flash Builder Beta 2

The latest builds of SDK 4.0 have been updated in preparation for
including playerglobal.swc for Flash Player 10.1. Flash Builder Beta 2
can not find playerglobal.swc due to the addition of the
{targetPlayerMinorVersion} variable found in the flex-config.xml file.

When using recent nightly SDKs with Flash Builder Beta 2, please modify them as follows:

1) Rename the folder <nightly sdk location>/frameworks/libs/player/10.0 to “10”

2) Edit the file <nightly sdk location>/frameworks/flex-config.xml and remove “.{targetPlayerMinorVersion}” and save

When
you restart Flash Builder, we will now find a correct location for
playerglobal.swc, allowing for code hints and many other features to
work properly.

Update: Also make sure you’re using the correct namespace declaration. Replace xmlns:mx=”library://ns.adobe.com/flex/halo” with xmlns:mx=”library://ns.adobe.com/flex/mx“. When using the nightly builds, Beta 2 does not create MXML files with the correct namespace. Thanks.

Share on Facebook