Thursday, September 20, 2007

Flex Bug?

I came across some strange behavior in Flex 2 today. I think this is a bug, but if someone has any insight feel free to comment. The issue is, I am trying to inject two resource bundles into my application. One for the fr locale and another for the fr_CA locale. So I have two files called application_fr.properties and application_fr_CA.properties. When I use the following code I see that whichever one is second in the source code ends up being null. I have many other resource bundles for other locales that work, so I know I can have more than one. It seems though that something to do with the name of the .properties file is causing a problem.



[ResourceBundle("application_fr_CA")] private var rb_fr_CA:ResourceBundle;

[ResourceBundle("application_fr")] private var rb_fr:ResourceBundle;


In this case:
rb_fr == null; returns true
rb_fr_CA == null; returns false



If I change my code to:



[ResourceBundle("application_fr")] private var rb_fr:ResourceBundle;

[ResourceBundle("application_fr_CA")] private var rb_fr_CA:ResourceBundle;



In this case:
rb_fr == null; returns false
rb_fr_CA == null; returns true.


Anyone know what the deal is here?