Reputation: 1393
I have a properties file called projecteditorsample.properteries located at /resources/ilog/en_US/projecteditorsample
In Order to load the File from an mxml located at /src/modules/ilog/ I tried:
[ResourceBundle("../resources/ilog/projecteditorsample")]
[HostComponent("spark.components.ButtonBar")]
]]>
</fx:Metadata>
<fx:Declarations>
<fx:Component id="middleButton" >
<s:ButtonBarButton skinClass="modules.ilog.CustomButtonBarMiddleButtonSkin"
width="{resourceManager.getString('projecteditorsample','buttonbar.width') as Number}"
height="{resourceManager.getString('projecteditorsample','buttonbar.height') as Number}"/>
I got the Error: Unable to resolve resource bundle .:/resources/ilog/projecteditorsample for locale en_US. What is the right reference ?
Upvotes: 1
Views: 231
Reputation: 20210
Here a snippet from an interesting link.
Now here’s one tricky point. This directory must be one of the source directories in your Flex project. The compiler has to be able to crawl to those properties files, and it stays away from any place you haven’t specified in your build path. Again, even if I only have one locale ever, I like to keep this parameterized. Assuming you used the directory structure above, step one is to add the following directory to your build path:
locale/{locale}
The play-by-play, if you need it: right-click your project, choose Properties. Choose ActionScript Build Path on the left column, choose the Source Path tab, click Add Folder… and enter locale/{locale}.
Upvotes: 1