This content has been marked as final. Show 6 replies
I don't think you can write to .properties files from a Flex app, only from an AIR app. You might want to use a SharedObject for developers, and the .properties file for production.
Thanks, Greg. Can you read from a .properties file? I just need to manually set some values in the .properties file (via a text editor) and then read it via Flex.
The Flex project properties files do not exist at run-time.
Are you speaking in general, of needing to initialize your application at run time with some values?
The simplest way to do this is to pass the values into the Flex app from the html wrapper, via flashvars. You just need a different version of the wrapper for each different deployment. This is the way I do it. It also makes it easy to have different launch configurations in FlexBuilder.
Another solution is to use HTTPService to load an xml file containing your initialization data. Of course that way you have to have an URL for the HTTPService...
In general, .properties files are just text files, saved as UTF-8, so you can edit them in FB.
Does this mean Flex can not read a properties file on runtime? But the resource bundles allows us to read from properties file. I don't get it.
thanks in advance
You can read a "properties file" if it is on the server.
...else Tracy has the correct idea of using the HTML wrapper and "flashVars" via a, say, PHP runtime generator.