Adobe Flex 3 Help

Editing framework resource properties

You can use the framework resource bundles to define some of the global strings that show up in framework components. For example, you can change the days of the week that show up in the DateField control, or the default date format used by the DateFormatter control. These strings are defined by the framework resource bundles.

The properties files that define the framework resources are uncompiled and stored in the framework resource bundle SWC files. For Flex Builder, the SWC files are located in flex_builder_dir/sdks/sdk_version/frameworks/locale/default_locale. For the SDK, the SWC files are located in the sdk_dir/frameworks/locale/default_locale directory.

In many cases, these properties files define the compiler error strings that might occur when you compile your applications. However, the SharedResources.properties file in the framework_rb.swc file defines the following:

  • Day names and month names for the DateBase, DateChooser, DateField, CalendarLayout controls.
  • Date formats for the DateFormatter, DateValidator, and DateField controls.
  • Decimal and thousands separator characters for the CurrencyFormatter, NumberFormatter, and Slider controls.
  • Currency symbols for the CurrencyFormatter and CurrencyValidator controls.

The formatters.properties in the framework_rb.swc file defines the following:

  • Number formatting properties for the CurrencyFormatter and NumberFormatter controls.
  • Currency precision for the CurrencyFormatter control.
  • Phone formatting properties for the PhoneFormatter control.
  • ZIP code format for the ZipCodeFormatter control.
  • Short day names and month names for the DateBase control.

In addition, the controls.properties file in the framework_rb.swc file defines the short day names for the DateChooser, DateField, and CalendarLayout controls.

Edit a framework resource properties file for SDK 3

  1. Extract the SharedResources.properties file from the framework_rb.swc file by using WinZip, PKUnzip, or similar archiving tool.
  2. Open the SharedResources.properties file in a text editor.
  3. Make any necessary changes to the properties file. For example, to change the long day names, edit the following line:
    dayNames=Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday
    
    
  4. To use a custom abbreviation for the day names, change the line to something like the following:
    dayNames=SU,MO,TU,WE,TH,FR,SA
    
    
  5. Re-archive the contents of the SWC file by using WinZip, PKZip, or similar archiving tool.
  6. Recompile your application. The new strings should appear in your controls.

Edit a framework resource properties file for SDK 2.0.1

For SDK 2.0.1, the framework resource properties files are not compiled into the framework resource bundle SWC files. Therefore, you can just edit the text files and recompile your application to change the global strings.