How do you load external XML into a dataProvider?

I have been looking through the docs and have found a couple
of entries discussing how to load external XML. Unfortunately, that
is where the example stops and there is no example of doing
anything useful with that data.
I have managed thus far to get my XML file loaded into
actionscript/flex:
function getExternalXML():void {
request = new URLRequest('source.xml');
loader = new URLLoader();
loader.load(request);
loader.addEventListener("complete", loadXML);
function loadXML(e:Event):void {
combo.dataProvider = loader.data;
obviously, the above doesn't work at all. I don't know how to
convert the loader.data into a format that the
ComboBox.dataProvider understands. I can't believe I have to write
a function to parse this XML. Surely there must be a way to simply
convert the XML to an array or something???

That link uses the flex beta 3 docs. You may want to use the
current livedocs.
Here
is a direct link to the section I was talking about.
Scroll down about halfway to the part that says "However,
using a raw data object..."
If you want the PDFs (easier to read IMO) you can get them
here.
Here
is a direct link to the Developer's Guide:

Similar Messages

  • How do you load artworks automatically into the indeisgn CS3

    Hi All,
    How do you load artworks automatically into the indeisgn CS3. Is it through a script or any other way.
    Thanks
    Devakanth

    "artworks" is a bit vague...can you expand?
    File > Place is the usual way, but there are times when cut and paste is fine or better.

  • How to load external XML into DataGrid ??

    Hello ,everybody , I can't load external Xml like this format
    <list>
    <month name="Jan-04" revenue="400263" average="80052">
    <region name="APAC" revenue="46130"/>
    <region name="Europe" revenue="106976"/>
    <region name="Japan" revenue="79554"/>
    <region name="Latin America" revenue="39252"/>
    <region name="North America" revenue="128351"/>
    </month>
    <month name="Feb-04" revenue="379145" average="75829">
    <region name="APAC" revenue="70324"/>
    <region name="Europe" revenue="88912"/>
    <region name="Japan" revenue="69677"/>
    <region name="Latin America" revenue="59428"/>
    <region name="North America" revenue="90804"/>
    </month>
    </list>
    I only can load with node format like this :
    <order>
    <item>
    <menuName>burger</menuName>
    <price>3.95</price>
    </item>
    <item>
    <menuName>fries</menuName>
    <price>1.45</price>
    </item>
    </order>
    Please tell me what am I going to do?
    Thanks!

    I'm stuck on this as well. I've read through the above
    samples and postings and am now feeling really retarded. I thought
    throwing the contents of a simple XML doc into a DataGrid would be
    easy, but I've been trying all morning and no love. Any help is
    appreciated.
    Here the XML --> guides.xml
    <?xml version="1.0" encoding="UTF-8">
    <GuideList title="Current Guides">
    <GuideItem>
    <GuideName>11699240</GuideName>
    <DisplayName>Supercharged Branding
    Program</DisplayName>
    <LinkText>View Downloadable Guide</LinkText>
    <Franchise>Film/TV</Franchise>
    <Property>Cars</Property>
    </GuideItem>
    <GuideItem>
    <GuideName>11721503</GuideName>
    <DisplayName> Packaging & Retail
    Signage</DisplayName>
    <LinkText>View Downloadable Guide</LinkText>
    <Franchise>Film/TV</Franchise>
    <Property>None</Property>
    </GuideItem>
    etc....
    Here's the flex --> GuideListDisplay.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" initialize="guidelist.send()">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable] private var myData:ArrayCollection;
    private function resultHandler(event:ResultEvent):void {
    myData = event.result.GuideList.GuideItem;
    ]]>
    </mx:Script>
    <mx:HTTPService id="guidelist" url="assets/guides.xml"
    result="resultHandler(event)"/>
    <mx:Panel title="{myData.GuideList.title}"> // 1119
    <mx:DataGrid x="29" y="36" id="Guides"
    dataProvider="{myData.lastresult.GuideList.GuideItem}"> // 1119
    <mx:columns>
    <mx:DataGridColumn headerText="Guide Number"
    dataField="GuideName"/>
    <mx:DataGridColumn headerText="Guide Name"
    dataField="DisplayName"/>
    <mx:DataGridColumn headerText="DisplayText"
    dataField="LinkText"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Panel>
    </mx:Application>
    The lines throw with // 1119 throw a problem notice - 1119:
    Access of possibly undefined property GuideList through a reference
    with static type mx.collections:ArrayCollection.
    GuideListDisplay.mxml Lessons line 17 March 21, 2007 12:53:45 PM
    215
    Please help before hari kari looks like a good option.
    Thanks!

  • Load external XML into DataGrid with AS3

    I've really looked hard to find an example/tutorial for
    loading external XML data into a DataGrid component using AS3. The
    code I'm using at the moment has the XML data in the AS code. If
    anyone can point me to a good resource(s) for code or a tutorial
    I'd be very appreciative. It needs to be AS3. ~steve
    Here is the code that is working for internal XML data:
    import fl.controls.dataGridClasses.DataGridColumn;
    import fl.data.DataProvider;
    stop();
    var emailXML:XML = <emails>
    <email date="06-04-07" code="EMRPAAV" campaign="This is
    the campaign details."/>
    <email date="06-11-07" code="EMRPAAW" campaign="This is
    the campaign details."/>
    <email date="06-18-07" code="EMRPAAX" campaign="This is
    the campaign details."/>
    <email date="06-25-07" code="EMRPAAY" campaign="This is
    the campaign details."/>
    <email date="07-02-07" code="EMRPAAZ" campaign="This is
    the campaign details."/>
    <email date="07-09-07" code="EMRPABA" campaign="This is
    the campaign details."/>
    </emails>;
    var dateCol:DataGridColumn = new DataGridColumn("date");
    dateCol.headerText = "Date";
    dateCol.width = 60;
    var codeCol:DataGridColumn = new DataGridColumn("code");
    codeCol.headerText = "Source Code";
    codeCol.width = 70;
    var campaignCol:DataGridColumn = new
    DataGridColumn("campaign");
    campaignCol.headerText = "Campaign";
    campaignCol.width = 300;
    var myDP:DataProvider = new DataProvider(emailXML);
    emailData.columns = [dateCol, codeCol, campaignCol];
    emailData.width = 440;
    emailData.dataProvider = myDP;
    emailData.rowCount = emailData.length;
    // end code

    Here is how you build it for external XML. in my example am
    using the same xml format that you are using . The xml file called
    "dataGrid.xml"
    import fl.controls.dataGridClasses.DataGridColumn;
    import fl.data.DataProvider;
    import fl.containers.UILoader;
    import fl.data.DataProvider;
    import fl.events.*;
    import flash.xml.*;
    var emailXML:XML;
    var myList:XMLList;
    function parseXML():void
    var url:String = "dataGrid.xml";
    var urlRequest:URLRequest = new URLRequest(url);
    var loader:URLLoader = new URLLoader();
    loader.addEventListener("complete" , loadXML);
    loader.load(urlRequest);
    /*var emailXML:XML = <emails>
    <email date="06-04-07" code="EMRPAAV" campaign="This is
    the campaign details."/>
    <email date="06-11-07" code="EMRPAAW" campaign="This is
    the campaign details."/>
    <email date="06-18-07" code="EMRPAAX" campaign="This is
    the campaign details."/>
    <email date="06-25-07" code="EMRPAAY" campaign="This is
    the campaign details."/>
    <email date="07-02-07" code="EMRPAAZ" campaign="This is
    the campaign details."/>
    <email date="07-09-07" code="EMRPABA" campaign="This is
    the campaign details."/>
    </emails>
    parseXML();
    function loadXML(evt:Event):void
    emailXML = new XML(evt.target.data);
    myDP = new DataProvider(emailXML);
    emailData.dataProvider = myDP;
    var dateCol:DataGridColumn = new DataGridColumn("date");
    dateCol.headerText = "Date";
    dateCol.width = 60;
    var codeCol:DataGridColumn = new DataGridColumn("code");
    codeCol.headerText = "Source Code";
    codeCol.width = 70;
    var campaignCol:DataGridColumn = new
    DataGridColumn("campaign");
    campaignCol.headerText = "Campaign";
    campaignCol.width = 300;
    var myDP:DataProvider;
    emailData.columns = [dateCol, codeCol, campaignCol];
    emailData.width = 440;
    emailData.dataProvider = myDP;
    emailData.rowCount = emailData.length;

  • How do you load from iPhoto into PS?, How do you load from iPhoto into PS?

    Hi, there:
    I tried to load a photo from iPhoto into PS and can't make it work.  Actually, I just uploaded all my snaps from my iPhone and wanted to use one to go through the tutorials, and the computer decided I wanted to go to iPhoto.
    How do I get a picture into PS?
    Thanks.

    Hi Amindthatsuits,
    Please follow the below instructions.
    In the Finder, navigate to your iPhoto package file. By default, it's located in /Users/[user name]/Pictures, and it's called iPhoto Library.   
    Control-click the iPhoto Library file and choose Show Package Contents.
    A Finder window opens that shows the contents of the package file. The Masters folder contains all of the photos that are in iPhoto. However, Photoshop cannot access this folder.
    Control-click the folder named Masters and choose Duplicate.   
    Drag the folder named "Masters copy" from the iPhoto Library Finder window to your Desktop. Now you can open images from the desktop in Photoshop.
    Thank you for posting on Adobe Forums.

  • HOW DO YOU LOAD A CD INTO A MAC BOOK LAP TOP

    trying to load turbotax cd into my macbook

    A [https://www.google.com/search?q=Mac+user+group&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8num=100&gws_rd=ssl Mac Users Group] would be the place to ask that question, which isn't related to Firefox support. Thanks for your understanding.

  • How do you load new ringtones into Iphone4?

    I have downloaded and paid for Ringtones but I cannot make them appear in the selection list? Can anyone advise how to do this?

    If you purchased them on your computer, you have to connect your iPhone and make sure ringtone syncing is turned on in iTunes.

  • How do you load an swf into another FLA document

    Well, the headline pretty much says it all. I have gotten some swf files from another designer. I need  to show them in my presentation. I am using Flash CS3 for mac. Any advice would be helpful.
    Thanks,
    Rich

    I did find a tutorial on this. It was helpful. I am using Actionscript 3.0
    Here is the code I used and it works. Except, I need to load another one after this one. Basically it is like a slide show of swf files. I need to play 3 swf files after another without any interaction by the user.
    I am thinking I need to tell it to unload the first one and load the second one after the first one is finished and so on. I appreciate any advice.
    Rich
    var Xpos:Number=0;
    var Ypos:Number=0;
    var swf:MovieClip;
    var loader:Loader=new Loader();
    var defaultSWF:URLRequest=new URLRequest("swfs/dannon_1.swf");
    loader.load(defaultSWF);
    loader.x=Xpos;
    loader.y=Ypos;
    addChild(loader);

  • Load external jpeg into flash movie

    Hi, how do i load external jpeg into flash movie?
    Can someone show me the actionscript? Thanks

    hi, i pasted the code on a mc but it didn't work.
    However, when i put in on frame action, it works.
    However, i realised the image flickered (more like refreshed)
    after afew sec...
    Is this normal? Is it the loop problem? how do i get rid of
    that?

  • How to load a XML into Checkpoint in UFT API using custom code

    I am automating a webservice using UFT-12. In which I am trying to load a xml into the checkpoint at run time. but I am not able to find out a way of doing it.Can any1 help me on this?

    @piyu_sh_arm 
    ‎Thank you for using HP Support Forum. I have brought your issue to the appropriate team within HP. They will likely request information from you in order to look up your case details or product serial number. Please look for a private message from an identified HP contact. Additionally, keep in mind not to publicly post ( serial numbers and case details).
    If you are unfamiliar with the Forum's private messaging please click here to learn more.
    Thank you,
    Omar
    I Work for HP

  • How do you load an AS2 swf into AS3?

    I think this is the way around my dilemma. How do you load and AS2 .swf into an AS3 file?
    thanks again!
    Steve

    check that code in your last thread:
    What is the  code to load a .swf file in AS3 on the same layer?

  • How do you load exs. format files into EXS 24 sampler?

    How do you load EXS24 format files into the EXS24 sampler? the only format I can load directly is aiff and wav. can't find any posts addressing this question? please help

    You don't load them in, you need to put them in:
    *System/users/your user name/library/application support/logic/Sampler instruments*
    Restart Logic if it's running, they will then appear in the EXS library.

  • How do you load cards into passbook?

    how do you load cards into passbook?

    Hi Darcie,
    No, as far as I know there's no load standard load program for CRM product catalog data. We're on v4.0, so I can't say what's been added in later releases.
    Anyway, if you write your own, have a look at package COM_PRDCAT_WEB_API which contains lots of goodie function modules you can use to manipulate product catalog data.
    Dont forget
    CALL FUNCTION 'COM_PRDCAT_TRANSACTION_BEGIN'
    at the start and
    CALL FUNCTION 'COM_PRDCAT_TRANSACTION_COMMIT'
    at the end.
    There's also package COM_PRDCAT, but when we tried to do stuff with FMs in this package we ran into errors since some global variables were undefined.
    Hope this helps.
    Regards,
    Rasmus

  • TS1702 how do you load apps into Passport

    how do you load apps into passport

    You need to download apps that are compatible with passbook.  There are less than 20 available right now I'd say
    Such as:
    Target
    American Airlines
    Fandango
    Ticket Master
    If you click the link to the app store through passbook and get an error, use this article to fix it: http://www.macworld.com/article/2010185/fix-passbooks-app-store-error-in-ios-6.h tml
    You can also use this site: http://www.passsource.com/ to create your own cards such as Blockbuster card, petco card, petsmart card, etc
    So if you have the target app you need to go into the target app > my target> mobile coupons > scroll to bottom of page  and click "add to passbook"
    My assumption is that you need to add things to passbook through the target app or american airlines app and so on.

  • Loading Large XML into Oracle Database

    Hi,
    I am fairly new to XML DB. I have been successful in registering a schema to a table in the Database. Now, I have to load the appropriate XML into that table. I am using the Simple Bulk Loader program found on this oracle site, however, when I load my XML file I get the following error: ORA-21700: object does not exist or is marked for delete.
    So, I figured maybe simple bulk loader cannot handle large files? So I reduced my XML file and loaded it with the program and it worked. However, does anyone know how I can load large files into my registered schema table.
    Thanks,
    Prerna :o)

    Did you specify genTables true or false when registering the XML Schema ?
    Does you XML schema contain a recursive definition
    Is it possible that after reducing the size of the document you no longer have nodes that contain recursive structures...

Maybe you are looking for

  • Can teamcenter community be used for source control?

    I have this new tool called teamcenter community and I'm trying to see how well it will work with source control for labview. I haven't learned how to use it fully yet, but when I try to open a vi get the error message: The document could not be open

  • My N8 is dead. 'What would you do with it ?'

    Well so far my N8 adventure. After daily irritations of Nokia Messaging not 'push'ing my e-mail. My N8 suddenly became non-responsive and then went dark. And now it's dead. Even hard reset (key combination) doesn't work anymore.

  • Flash player download won't pass integrity check

    I'm trying to update my flash player. I used the adobe 'remover', rebooted then tried to download version 10.0.45.2 but it won't pass the integrity check. I'm tried with firefox first (clicking the 'allow' notices) then tried with internet explorer.

  • Import from Canon 5D does not load

    I imported directly from my Canon 5D via iPhoto. All the images were clearly visible as they imported, but when the import was done, all thumbnails were just blank white squares. Double-clicking on them resulted in a large, low-res "exclamation" icon

  • Imessage not connecting to phone number ios 8.1

    Imessage is not sending from phone number, when I try to change from email to phone number, phone number is grey and you can not choose it. I have factory reset my phone three times. Help!!!