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: [email protected] [mailto:[email protected]] On
Behalf Of Gautam P
Sent: Thursday, August 20, 2009 4:56 AM
To: [email protected]
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, mattcalthrop<mcalth...@gmail.
<mailto:[email protected]> 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:[email protected]> ups.com,
Gautam P <p.gau...@...> wrote:
>>
>> var imageXML:XML = new XML('<imageList><image
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, mattcalthrop<mcalth...@...> 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:[email protected]> [email protected]
>
>
>



Reply via email to