1 Reply Latest reply on Feb 20, 2012 2:15 AM by Innovatology

    Loading Property Files at Runtime




      Is it possible to load property/resource files individually at runtime?

      I already load resource bundles into my app at runtime. These contain all the flex framework property files and it works fine.

      However I have a seperate custom property file which contains all the localised strings for my app.

      I dont want to add these into the resource bundle swf's as they can change a lot and would require me to re-compile the resource bundles very frequently.

      What I would like to be able to do is have the relevant resource bundle loaded at runtime(done) and then pull in a seperate resource file for all the custom strings.

      From what I've read it seems I need to compile this seperate file into a SWF as well which isn't ideal.



        • 1. Re: Loading Property Files at Runtime
          Innovatology Level 3

          You could use xml files, then load the correct XML at runtime. Or link them into your .swf at compile time (with [Embed...]) and just point a variable to the correct data. In MXML you could do something like:


          <s:Label text="{language.helloworld}" />


          where language is just a bindable var of type XML and helloworld is an element within your xml file, or


          <s:Label text="{Languages.current.helloworld}" />


          where Languages is a class and current is a bindable static public var of type XML.