[flexcoders] Re: external XML to image tile
You haven't said where your xml files live, so I am going to presume you have a server infrastructure to deliver them. If you don't then you either need to make one or use the desktop version of Flex, Air. If you need guidance on how to make a server then I think it is outside this forum (go and look at JBoss/J2EE or PHP or ColdFusion or .Net if you don't ever want your server to run outside Windows). There are many ways of getting the data back, but since you are talking about XML my guess would be HTTP (rather than AMF). The flash player is single threaded so you don't get truly asynchronous processing on the client, however your responders for your server requests are event driven and will fire asynchronously and be processed as the responses come in from the server (the order is random, the processing is synchronous). Use the XML object in flex to handle the payload of your response. That will do all the parsing for you and give you access to your model. You'll have to traverse the data yourself to get at the elements and attributes you need for display but that is all well documented and fairly simple and I am sure you have seen it, the only bit missing is the knowledge of your model(s) and only you have that. There are many ways of displaying lists, and many examples of how to do it. Start by reading up about the HorizontalList control and ItemRenderers. If your model is reasonably coherent then there a chance you could bind directly to it from your display controls, which is about the simplest client implementation you can get. good luck and hth get you started Simon --- In flexcoders@yahoogroups.com, missgiggygirl [EMAIL PROTECTED] wrote: It has been awhile since I dabbled in Flex, but I am back. Can someone help me to: - parse an external XML file - write the contents (Image thumbnail, text name, text description, and id#) to some sort of tile horizontally - I actually will have 7-10 XML files, each with similar content above, that must be read asynchronisly (sp.?) I feel this should be an easy task, but all of the examples I am finding are with local XML and really simple XML... my XML is external and not at all simple Any advice is appreciated, Miss Giggy
[flexcoders] Re: external XML to image tile
Thank you Simon for the overview. :) The XML is done by someone else, and is already done, so that is not an issue. I know I have to use the XML object to use the incoming XML, but I really haven't seen much (if any) code that shows how to do this with external XML. I have seen a lot of code that binds internal XML lists to elements, however. Maybe I am using the wrong search terms or am somehow glancing over stuff I could be using. Another issue is I want to use a code behind model, and again I don't see a lot of stuff using this method. Thanks again for your response, Miss Giggy
[flexcoders] Re: external XML to image tile
I guess I don't really understand what you mean by internal and external XML. My immediate reaction is to say XML is XML, if it is well formed then there are a standard set of APIs for getting at the elements and attributes. You'll have to use those APIs to decipher the model and you should have a DTD or schema to describe the model and facilitate that. If you want application logic bound up in your model (code behind model) then you might do better to have a client domain model which reflects what you are trying to do with the data and a layer in your architecture which transforms the XML model from the form that has already been defined into something more suited to your display needs. Maybe you should research MVC design pattern. Alternatively use a factory pattern and have all your procedural code in static functions which operate on the model. Both approaches are sound architecturally. If you go the route of a separate domain model remember that you'll probably need a 2-way mapping, so make sure you consider both reading and writing when designing your model (it's easy to lose information if you only consider reading and then not be able to reconstitute the orginial model when you come to write). Depending on whether you have any control over your server architecture you can decide whether you do the transformation on the server or the client. Each route has its own merits. --- In flexcoders@yahoogroups.com, missgiggygirl [EMAIL PROTECTED] wrote: Thank you Simon for the overview. :) The XML is done by someone else, and is already done, so that is not an issue. I know I have to use the XML object to use the incoming XML, but I really haven't seen much (if any) code that shows how to do this with external XML. I have seen a lot of code that binds internal XML lists to elements, however. Maybe I am using the wrong search terms or am somehow glancing over stuff I could be using. Another issue is I want to use a code behind model, and again I don't see a lot of stuff using this method. Thanks again for your response, Miss Giggy
[flexcoders] Re: external XML to image tile
PS: I am using Flex 2