Control-Clicking into the Flex Framework
There is a great feature in Flex Builder where you can control-click (command-click on a mac) on a class/variable/function to navigate to it's definition. It has annoyed me for a while that this doesn't work for the Flex framework. The reason is that the framework is included in your project as a series of SWC files. I've been experimenting a bit, and I've got a decent workaround: adding the framework source as an external source path to your project.
The solution:
Open up your project properties and click on "Flex Build Path". The "Library path" tab contains all of the framework SWCs -- leave those alone. Click on the "Source path" tab, and then "Add Folder...". The location of your framework source will vary, but mine looks like this: "C:/Program Files/Adobe/Flex Builder 3 Plug-in/sdks/3.0.0/frameworks/projects/framework/src". This src folder should contain a folder called "mx" which has all of the Flex component definitions.
When you hit "OK" on the project properties window, Flex Builder will add a liked folder to your project called "[source path] src". You can delete this if you like... the dialog will tell you: "Only the workspace link will be deleted. Link target will remain unchanged." Click "OK".
Now try control-clicking an import for a Flex framework class such as UIComponent. Success!
It seems a bit risky having the component definition in your project twice (once in a SWC, and once in the external source path), but so far I haven't noticed any negative side effects. The size of my swf is the same, and compile time doesn't seem to have increased. If anybody knows some problems that could arise from doing this, I'd love to hear about it.
Disclaimer:
I don't guarantee this won't screw something up, and I don't necessarily recommend doing this on every project... but it's a great way to dive in and learn more about the internal workings of the Flex framework.
About this entry
You’re currently reading “Control-Clicking into the Flex Framework,” an entry by Ryan Phelan
- Published:
- 03.13.08 / 10am
- Category:
- Flex, Flex Builder






3 Comments
Jump to comment form | comments rss [?] | trackback uri [?]