Monthly Archives: January, 2010

Flex Bug Database upgraded to JIRA 4

Adobe finally did the upgrade to JIRA 4. Because we had so many customizations and teams using the same bug database, this upgrade took us a while. However, as of today, our instance of JIRA is now JIRA 4.

I have to say, the performance seems a lot faster. I hope you have the same experience!

http://bugs.adobe.com/flex

Avoiding a Flex 4 error when using PopUpManager.addPopUp()

There is a problem in Flex 4 when you using the PopUpManager’s addPopUp() method to create a pop up that has a Spark container parent. This problem was reported in a JIRA bug: SDK-25082. If you call addPopUp(), you will get the runtime error:

Error: removeChild() is not available in this class. Instead, use removeElement() or modify the skin, if you have one.
at spark.components::Group/removeChild()

Unfortunately, we didn’t have time to fix this bug in the Flex 4 time frame. So, the bug was deferred. However, there is a pretty simple workaround for the bug. In your code, you just need to parent the component that you want to pop up with an MX component.

Here are a couple of examples:

Error Example: AddPopUpErrorExample.swf, AddPopUpErrorExample.mxml

Workaround for Error: AddPopUpExample.swf, AddPopUpExample.mxml

If you would like this bug fixed in the future, please go to it and vote on it. Otherwise, this may stay a bug in the framework for all of eternity. 😦

Compiler error with selectedChild in Flex 4 with code that worked in Flex 3

A customer filed a bug recently about a backwards compatibility issue that they ran into when trying to compile their Flex 3 application in Flex 4. Normally, your application should compile just fine, but, you might run into some behavioral differences between the two releases.  However, in the case described in bug SDK-25021, your application won’t even compile! When using the ‘selectedChild’ property for any of the MX Navigators like TabNavigator, ViewStack or Accordion, you will get the following error in Flex 4:

Error: Implicit coercion of a value of type mx.core:INavigatorContent to an unrelated type flash.display:DisplayObject.

myViewStack.removeChild(myViewStack.selectedChild)

This code compiled fine in Flex 3, but, won’t compile in Flex 4. Unfortunately, we had to loosen the type of the selectedChild property to get the MX navigators working with Flex 4 Spark content. The type of selectedChild was ‘Container’, now it is ‘INavigatorContent’. In Flex 4, both the Container and NavigatorContent classes implement INavigatorContent. You will need to make some minor tweaks to your Flex 3 code to have it compiling in Flex 4.

To resolve the compile error, just cast your selectedChild property to a Container. For example, here is the Flex 3 code converted to Flex 4 code:

Flex 3: myViewStack.removeChild(myViewStack.selectedChild)

Flex 4: myViewStack.removeChild(Container(myViewStack.selectedChild))
I hope this makes the migration easier. Good luck!