Sunday, September 5, 2010

Migrating an application to AIR, and Flex unable to resolve resource bundle

Not sure why but migrating from a web application to AIR I ran into a few issues

Flex AIR unable to resolve resource bundle

To do this, simply right click your project > properties > Flex compiler and add "-source-path ../locale/{locale}" to the Additional compiler arguments text field.  Hat tip.

Specifying startup height and width
Code Snippet
  1. <!-- The window's initial width. Optional. -->
  2. <!-- <width></width> -->
  3. <width>1320</width>
  4. <!-- The window's initial height. Optional. -->
  5. <height>920</height>
Asset references

Shame on me for not refering to images, fonts, etc with an absolute path (relative to the flex src directory), e.g…

Code Snippet
  1. <mx:Image source="@Embed(source='/../assets/some_icon.png')"/>

This also has the happy side effect of making the paths of these assets more sensible than the alternative crazy relative path approach, e.g. the above line replaced a line similar to the following…

Code Snippet
  1. <mx:Image
  2. source="@Embed(source='../../../../../../../assets/some_icon

No comments: