I am creating an app in Flex 3.4. In a particular view, I have some label texts which I will want to customize sometime later. So I want to store them in a xml file. Now defining the xml structure inside the mxml file is I guess not recommended since, everytime I will change the xml I will have to regenerate the swf file, plus non-technical person won't be able to find that out too easily.
So I thought of storing the data in an external file and accessing it like <mx:XML source="data.xml" />. My questions about this are...
Can somebody shed some light on this topic?
thanks and regards
You can use URLLoader to load xml at runtime into flex application. SInce the file is loaded at runtime, there is no need to recompile the code.
Once you get the xml data, you can store the nodes in a Singleton class so that the data loaded from the xml is accessible all over the application.
You may also want to try Cairngorm ( http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm;jsessionid=BEB98753C31FEB0F4C 30E50F98CC1B91 ) which is an MVC architecture for flex. It has singleton class(ModelLocator) for central data storage.
Made use of data models and HttpService