As you may have heard, Flex 2 beta 3 is out. Here are some quick tips for the new beta.
There were a couple things that tripped me up during migration that you might want to watch out for:
- If you use states… the “target” property of the AddChild tag has been renamed “relativeTo”. Unfortunately, the “target” property still exists, but it now means something different. My suggestion is to do a search for AddChild and change “target” to “relativeTo” as one of the first things you do in moving to beta 3. If you forget to do this, you get a somewhat cryptic runtime error (“Cannot add a child that is already parented”) when you switch into that state.
- If you use trace… Don’t worry when it tells you that flash.util.trace is an invalid import. You no longer need to import anything to use trace.
Source code available for the framework
The most exciting news is that the framework source is now part of the beta distribution. You can use this to debug, to help you understand how components are created, and to serve as the basis for new components that you may want to build.
For most project types, debugging into framework source “just works”. Step into framework source just as you would with any other source code.
You can also navigate to the source by ctrl-clicking on a class name, method name, or MXML tag.
Using framework source with FDS
For FDS projects with server compile, the source attachment for framework.swc is not automatically set in beta 3, due to the different way in which the compiler is used. You can work around this, but it is pretty difficult to figure out:
- Navigate to thisproject properties > Flex Build Path > Library Path >. Find framework.swc, which is in the second node in the list.
- Open up the framework.swc node to view the source attachment.
- Even though it looks like the source attachment is not editable, go ahead and double click where it says “Source Attachment: (None)”.
- You should see this dialog box. Now hit “Browse…”
- Navigate to [FDS directory]/flex_sdk_2.0/frameworks/source.
At this point, debugging into source will work for your FDS project should work correctly.