Wednesday, February 21, 2007

Internal Build Error

I recently ran into an issue with Flex Builder where I was getting the "An internal build error has occurred. Please check the Error Log." error when trying to debug my project. Absolutely nothing worked including all the normal practices such as cleaning the project, recreating the workspace, manually deleting the bin folder, reinstalling Flex Builder, etc.

After performing all of these tasks I was still getting "Uncaught exception in compiler" in the error log, which by the way is the .log file in the .metadata folder of your workspace. After further analysis, I tied the issue back to a missing semi-colon after a variable declaration in my class such as:

public class SomeClass
      public var blah:Object

If you ever find yourself in this situation, start rolling back code and begin to do a detailed analysis for syntax errors that normally do not pose any problems.

Wednesday, February 14, 2007

Flex tree's with a context menu

Recently on the flexcoders list a question was posed regarding how to get the item that was 'right-clicked on' when dealing with a tree. There are a few steps to follow if you plan to implement a context menu that is dynamic based on individual tree items.

First, you need to use the itemRollOver event of the <mx:Tree> component to track the last item that was rolled over, and save it to a variable for later use. Then when the ContextMenuEvent.MENU_SELECT event is triggered, you will refer back to this variable as it holds a reference to the itemRenderer and therefore the data you need access to.

You can view an example here and view the code here...

Updated Flex Style Explorer v2.0.1

I just realized that Adobe Consulting released a new version of the Flex Style Explorer. The style explorer is great if you want to see what you can do with CSS in flex. It's also a good way to start working with styles, although you must keep in mind that this is just the beginning of how you can tweak the look and feel of your flex applications.