[flexcoders] Re: How to use XML file as dataProvider for s:List
--- In flexcoders@yahoogroups.com, Tracy Spratt tr...@... wrote: You can use mx:XML source=myFile.xml . for compile time embedding or you can use HTTPService for run-time retrieval. You can also use URLLoader, which works the same locally or from a network.
Re: [flexcoders] Re: How to use XML file as dataProvider for s:List
if you need to load an external xml file from the file system rather than from the server, compile your flex project using the option * -use-network=false*. however, compiling in this fashion will not allow the swf to make calls to the server. On Thu, Aug 13, 2009 at 1:57 AM, mattcalthropmcalth...@gmail.com wrote: Thanks Gautam. I think we're almost there... except: I want the XML to reside in an external file, not as a string in the AS3 code. Is that easy to do? cheers, Matt --- In flexcoders@yahoogroups.com, Gautam P p.gau...@... wrote: var imageXML:XML = new XML('imageListimage location=path/to/image1.jpg/'+ 'image location=path/to/image2.jpg//imageList'); var s:List = new List(); s.dataProvider = imageXML.image; // this give a XMLList (e4x expression) s.labelfield = @location; // to display location in the list. to access attribute prefix @ symbol Regards, Gautam. On Wed, Aug 12, 2009 at 5:09 PM, mattcalthropmcalth...@... wrote: Hi all. I am using FB4, and want to specify an XML file to be used as the dataProvider for an s:List object. However, I just can't seem to work out how to do it. Have read manuals, done google searches, checked forums - all to no avail. Can anyone help me please? Format of XML file is thus: ?xml version=1.0 encoding=ISO-8859-1? imageList image location=path/to/image1.jpg / image location=path/to/image2.jpg / !-- ... -- /imageList many thanks in advance! Matt -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
RE: [flexcoders] Re: How to use XML file as dataProvider for s:List
You can use mx:XML source=myFile.xml . for compile time embedding or you can use HTTPService for run-time retrieval. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Gautam P Sent: Thursday, August 20, 2009 4:56 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: How to use XML file as dataProvider for s:List if you need to load an external xml file from the file system rather than from the server, compile your flex project using the option -use-network=false. however, compiling in this fashion will not allow the swf to make calls to the server. On Thu, Aug 13, 2009 at 1:57 AM, mattcalthropmcalth...@gmail. mailto:mcalth...@gmail.com com wrote: Thanks Gautam. I think we're almost there... except: I want the XML to reside in an external file, not as a string in the AS3 code. Is that easy to do? cheers, Matt --- In flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com, Gautam P p.gau...@... wrote: var imageXML:XML = new XML('imageListimage location=path/to/image1.jpg/'+ 'image location=path/to/image2.jpg//imageList'); var s:List = new List(); s.dataProvider = imageXML.image; // this give a XMLList (e4x expression) s.labelfield = @location; // to display location in the list. to access attribute prefix @ symbol Regards, Gautam. On Wed, Aug 12, 2009 at 5:09 PM, mattcalthropmcalth...@... wrote: Hi all. I am using FB4, and want to specify an XML file to be used as the dataProvider for an s:List object. However, I just can't seem to work out how to do it. Have read manuals, done google searches, checked forums - all to no avail. Can anyone help me please? Format of XML file is thus: ?xml version=1.0 encoding=ISO-8859-1? imageList image location=path/to/image1.jpg / image location=path/to/image2.jpg / !-- ... -- /imageList many thanks in advance! Matt -- Flexcoders Mailing List FAQ: http://groups. http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share. https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e6 2079f6847 acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail- http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups. http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share. https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e6 2079f6847 acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail- http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links (Yahoo! ID required) mailto:flexcoders-fullfeat mailto:flexcoders-fullfeatu...@yahoogroups.com u...@yahoogroups.com
[flexcoders] Re: How to use XML file as dataProvider for s:List
Thanks Gautam. I think we're almost there... except: I want the XML to reside in an external file, not as a string in the AS3 code. Is that easy to do? cheers, Matt --- In flexcoders@yahoogroups.com, Gautam P p.gau...@... wrote: var imageXML:XML = new XML('imageListimage location=path/to/image1.jpg/'+ 'image location=path/to/image2.jpg//imageList'); var s:List = new List(); s.dataProvider = imageXML.image; // this give a XMLList (e4x expression) s.labelfield = @location; // to display location in the list. to access attribute prefix @ symbol Regards, Gautam. On Wed, Aug 12, 2009 at 5:09 PM, mattcalthropmcalth...@... wrote: Hi all. I am using FB4, and want to specify an XML file to be used as the dataProvider for an s:List object. However, I just can't seem to work out how to do it. Have read manuals, done google searches, checked forums - all to no avail. Can anyone help me please? Format of XML file is thus: ?xml version=1.0 encoding=ISO-8859-1? imageList image location=path/to/image1.jpg / image location=path/to/image2.jpg / !-- ... -- /imageList many thanks in advance! Matt -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Re: How to use XML file as dataProvider for s:List
That's almost it - but I want the XML to reside in an external file, not in a string in the AS3. Is that easy? Matt PS - this may be a duplicate post... I replied already, but haven't seen it appear on the Y!group yet. --- In flexcoders@yahoogroups.com, Gautam P p.gau...@... wrote: var imageXML:XML = new XML('imageListimage location=path/to/image1.jpg/'+ 'image location=path/to/image2.jpg//imageList'); var s:List = new List(); s.dataProvider = imageXML.image; // this give a XMLList (e4x expression) s.labelfield = @location; // to display location in the list. to access attribute prefix @ symbol Regards, Gautam.
Re: [flexcoders] Re: How to use XML file as dataProvider for s:List
If you want to load it from the server its easiest to make a http request. If you don't need to change it at runtime. You can embed an xml easy enough. anyway to load one see http://livedocs.adobe.com/flex/3/html/help.html?content=13_Working_with_XML_11.html regards wes On Wed, Aug 12, 2009 at 10:53 PM, mattcalthrop mcalth...@gmail.com wrote: That's almost it - but I want the XML to reside in an external file, not in a string in the AS3. Is that easy? Matt PS - this may be a duplicate post... I replied already, but haven't seen it appear on the Y!group yet. --- In flexcoders@yahoogroups.com, Gautam P p.gau...@... wrote: var imageXML:XML = new XML('imageListimage location=path/to/image1.jpg/'+ 'image location=path/to/image2.jpg//imageList'); var s:List = new List(); s.dataProvider = imageXML.image; // this give a XMLList (e4x expression) s.labelfield = @location; // to display location in the list. to access attribute prefix @ symbol Regards, Gautam. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
RE: [flexcoders] Re: How to use XML file as dataProvider for s:List
You have two choices. You can embed the xml from an external file using mx:XML source=myFolder/Myfile.xml /, which is a compile-time process, or you can load it at run-time using httprequest as Matt says. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Wesley Acheson Sent: Wednesday, August 12, 2009 7:21 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: How to use XML file as dataProvider for s:List If you want to load it from the server its easiest to make a http request. If you don't need to change it at runtime. You can embed an xml easy enough. anyway to load one see http://livedocs. http://livedocs.adobe.com/flex/3/html/help.html?content=13_Working_with_XML _11.html adobe.com/flex/3/html/help.html?content=13_Working_with_XML_11.html regards wes On Wed, Aug 12, 2009 at 10:53 PM, mattcalthrop mcalth...@gmail. mailto:mcalth...@gmail.com com wrote: That's almost it - but I want the XML to reside in an external file, not in a string in the AS3. Is that easy? Matt PS - this may be a duplicate post... I replied already, but haven't seen it appear on the Y!group yet. --- In flexcod...@yahoogro mailto:flexcoders@yahoogroups.com ups.com, Gautam P p.gau...@... wrote: var imageXML:XML = new XML('imageListimage location=path/to/image1.jpg/'+ 'image location=path/to/image2.jpg//imageList'); var s:List = new List(); s.dataProvider = imageXML.image; // this give a XMLList (e4x expression) s.labelfield = @location; // to display location in the list. to access attribute prefix @ symbol Regards, Gautam. -- Flexcoders Mailing List FAQ: http://groups. http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share. https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e6 2079f6847 acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail- http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links (Yahoo! ID required) mailto:flexcoders-fullfeat mailto:flexcoders-fullfeatu...@yahoogroups.com u...@yahoogroups.com