Problem in external XML reading

Hi,
I am trying to develop a birthday application.The aim of the application is to populate all the birthday dates in datechooser and display the appropriate photograph of the person when the highlighted date is clicked.
When I am trying to access {xImages.img[i].BirthDate.toString()} value, it is giving an error : Error #1009: Cannot access a property or method of a null object reference
The following is the code:
Birthday Application
<mx:Script>
        <![CDATA[
            import mx.rpc.events.ResultEvent;
           public var mySource:String="assets/birthday/pictures/1.jpg"
           [bindable]private var xImages:XML
   private function init():void {
                imageData.send();
                dc1.displayedMonth = 2;
                dc1.displayedYear = 2009;
    public function displayDates():void {
                var dateRanges:Array = [];
                for (var i:int=0; i<shows.show.length(); i++) {
                    var cDate:Date =
                        new Date(xImages.img[i].BirthDate.toString());          
                    var cDateObject:Object =
                        {rangeStart:cDate, rangeEnd:cDate};
                    dateRanges.push(cDateObject);
                dc1.selectedRanges = dateRanges;
    function setPath(myPath:String):void
                mainImage.source=myPath;
            function resultHandler(event:ResultEvent):void
                xImages = event.result as XML
                trace (xImages.toXMLString());
        ]]>
    </mx:Script>   
<mx:HTTPService id="imageData" url="assets/birthday/images.xml" resultFormat="e4x" result="resultHandler(event)"/>
<mx:VDividedBox width="20%" height="100%">
    <mx:Panel height="68%" width="100%">
         <mx:DateChooser id="dc1"
        showToday="false"
        creationComplete="displayDates()"
    />   
    </mx:Panel>
    <mx:Panel height="100%" width="100%">
        <mx:Text text="this is for birthday pics"/>
    </mx:Panel>
</mx:VDividedBox>
<mx:Panel width="80%" height="100%">
<mx:VDividedBox width="100%" height="100%">
    <mx:Canvas height="100%" width="100%">
       <mx:Image id="mainImage" source="{mySource}" width="80%" height="80%" verticalCenter="0" horizontalCenter="0" />
    </mx:Canvas>
    <mx:HBox height="20%" width="50%" horizontalScrollPolicy="on" verticalCenter="0">
        <mx:Repeater id="imageRepeater" dataProvider="{imageData.lastResult.img}">
            <mx:Canvas width="55" height="55" backgroundColor="#000000" horizontalScrollPolicy="off" verticalScrollPolicy="off" borderStyle="solid">
                <custom:CustomImage path="{imageRepeater.currentItem.src}" width="89" height="100%" useHandCursor="true" buttonMode="true" source="{imageRepeater.currentItem.thumbnail}" verticalCenter="0" left="0" click="setPath(String(event.currentTarget.path));"/>
            </mx:Canvas>
        </mx:Repeater>
    </mx:HBox>
</mx:VDividedBox>   
</mx:Panel>
</mx:Application>
Example of XML file is as follows:
images.xml
<gallery>
<img>
<src>assets/birthday/pictures/1.jpg
</src> 
<thumbnail>assets/birthday/pictures/t1.gif
</thumbnail>
<BirthDate>02/28/2009</BirthDate>
<title>""</title>
<caption>""</caption>
</img>
<img>
<src>assets/birthday/pictures/2.jpg
</src> 
<thumbnail>assets/birthday/pictures/t2.gif</thumbnail>
<BirthDate>02/12/2009</BirthDate>
<title>""</title>
<caption>""</caption>
</img>
<img>
<src>assets/birthday/pictures/3.jpg
</src> 
<thumbnail>assets/birthday/pictures/t3.gif
</thumbnail>
<BirthDate>02/16/2009</BirthDate>
<title>""</title>
<caption>""</caption>
</img>
</gallery>
Can anybody correct me where I am doing a mistake. I am not able to figure out and is blocked here
Please help me
Thank you in advace,
Cheers,
KK

Hi
You are calling the displayDates() at creationcomplete() of DateChooser. But at that time your xImages(xml) is null because it is not initialized and the HttpServices is not returned the result.
So initialize your xml and call displayDates() after httpservices returns the result.
Hope this helps
Regards
Rush-me

Similar Messages

  • Problem loading external XML

    Hi, I"m having a problem with an Applet.
    I wrote a program that acceses an external XML file located on my webspace, but when I converted this program to run in a webbrowser I get console errors when trying to acces the file.
    Here's my code:
    package javaapplication;
    import java.applet.Applet;
    import java.awt.BorderLayout;
    import java.awt.Canvas;
    import java.util.ArrayList;
    import javaapplication7.parsing.XmlParser;
    public class Main extends Applet {  
        protected Thread gameThread = null;
        private Canvas display_parent = null;
        private boolean running = false;
        private XmlParser parser = new XmlParser();
        public void destroy() {
            remove(display_parent);
            super.destroy();
            System.out.println("Clear Up");
        public void start() {
            gameThread = new Thread() {
                public void run() {
                    running = true;
                    System.out.println("Entering Gameloop");
                    gameLoop();
            gameThread.setDaemon(true);
            gameThread.start();
        public void stop() {
        public void init() {
            setLayout(new BorderLayout());
            try {
                display_parent = new Canvas() {
                    public final void removeNotify() {
                        super.removeNotify();
                display_parent.setIgnoreRepaint(true);
                display_parent.setSize(getWidth(),getHeight());
                add(display_parent);
                display_parent.setFocusable(true);
                display_parent.requestFocus();
                setVisible(true);
            catch(Exception e) {
                System.err.println(e);
                throw new RuntimeException("Unable to create display");
        private void gameLoop() {
            ArrayList <String> temp = null;
            while (running) {    
                temp = parser.SearchXml("http://users.telenet.be/decoy/FacebookApp/xml/BulletType.xml", "BulletList",2);
                for (int i=0;i<temp.size();++i) {
                    System.out.println(temp.get(i));
    }my html file :
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
      <head>
        <title>AppletLoader</title>
      </head>
      <body>
      <applet code="javaaplication.Main" archive="JavaApplication7.jar" codebase="." width="800px" height="600px">
        <!-- The following tags are mandatory -->
        <!-- Name of Applet, will be used as name of directory it is saved in, and will uniquely identify it in cache -->
        <param name="al_title" value="appletloadertest">
        <!-- Main Applet Class -->
        <param name="al_main" value="javaapplication.Main">
        <!-- logo to paint while loading, will be centered -->
        <param name="al_logo" value="appletlogo.png">
        <!-- progressbar to paint while loading. Will be painted on top of logo, width clipped to percentage done -->
        <param name="al_progressbar" value="appletprogress.gif">
        <!-- List of Jars to add to classpath -->
        <param name="al_jars" value="JavaApplication7.jar">
        <!-- signed windows natives jar in a jar -->
        <param name="al_windows" value="lib/windows_natives.jar.lzma">
        <!-- signed linux natives jar in a jar -->
        <param name="al_linux" value="lib/linux_natives.jar.lzma">
        <!-- signed mac osx natives jar in a jar -->
        <param name="al_mac" value="lib/macosx_natives.jar.lzma">
        <!-- signed solaris natives jar in a jar -->
        <param name="al_solaris" value="lib/solaris_natives.jar.lzma">
        <!-- Tags under here are optional -->
        <!-- Version of Applet, important otherwise applet won't be cached, version change will update applet, must be int or float -->
        <!-- <param name="al_version" value="0.1"> -->
        <!-- background color to paint with, defaults to white -->
        <!-- <param name="al_bgcolor" value="000000"> -->
        <!-- foreground color to paint with, defaults to black -->
        <!-- <param name="al_fgcolor" value="ffffff"> -->
        <!-- error color to paint with, defaults to red -->
        <!-- <param name="al_errorcolor" value="ff0000"> -->
        <!-- whether to run in debug mode -->
        <!-- <param name="al_debug" value="true"> -->
        <!-- whether to prepend host to cache path - defaults to true -->
        <param name="al_prepend_host" value="false">
        <!-- main applet specific params -->
        <param name="test" value="test">
      </applet>
      <p>
        if <code>al_debug</code> is true the applet will load and extract resources with a delay, to be able to see the loader process.
      </p>
      </body>
    </html>console errors :
    network: Connecting http://users.telenet.be/decoy/FacebookApp/xml/BulletType.xml with proxy=DIRECT
    network: Connecting http://users.telenet.be/crossdomain.xml with proxy=DIRECT
    network: Connecting http://users.telenet.be:80/ with proxy=DIRECT
    network: Connecting http://users.telenet.be/crossdomain.xml with cookie "__utmz=226366239.1223468593.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); st8id_wlf_%2Etelenet%2Ebe_%2F=TE5HVExNX0ZMQVNI?81c37b0684bbf41f4c42c63db814f879; __utma=226366239.605535372.1223468593.1223556298.1224764225.3"
    network: Connecting http://www.zita.be/users_error/ with proxy=DIRECT
    network: Connecting http://www.zita.be:80/ with proxy=DIRECT
    java.security.PrivilegedActionException: java.io.FileNotFoundException: http://www.zita.be/users_error/
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.deploy.net.CrossDomainXML.check(Unknown Source)
         at com.sun.deploy.net.CrossDomainXML.check(Unknown Source)
         at sun.plugin2.applet.Applet2SecurityManager.checkConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.<init>(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at java.net.URL.openStream(Unknown Source)
         at facebookgame.parsing.XmlParser.SearchXml(XmlParser.java:38)
         at facebookgame.entity.ShotEntity.<init>(ShotEntity.java:62)
         at facebookgame.InGameState.Enter(InGameState.java:75)
         at facebookgame.FacebookApp.changeToState(FacebookApp.java:258)
         at facebookgame.MenuState.CheckPlayerInput(MenuState.java:106)
         at facebookgame.MenuState.StateCycle(MenuState.java:139)
         at facebookgame.FacebookApp.gameLoop(FacebookApp.java:212)
         at facebookgame.FacebookApp.access$200(FacebookApp.java:17)
         at facebookgame.FacebookApp$1.run(FacebookApp.java:60)
    Caused by: java.io.FileNotFoundException: http://www.zita.be/users_error/
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at com.sun.deploy.net.CrossDomainXML$2.run(Unknown Source)
         ... 22 moreHopefully some1 can help me :).
    Edited by: Veko on Dec 7, 2008 2:51 PM

    But why is it possible then to succesfully acces the .xml file with a non-web applet
    This code reads the file perfectly of my webspace...
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.net.URL;
    public class XMLHandler {
         public static void SearchXml(){
            try{
                InputStream filesource = new URL("http://users.telenet.be/decoy/FacebookApp/xml/BulletType.xml").openStream();
                System.out.println("found input source");
                byte[] readIn = new byte[8];
                int bytesRead = filesource.read(readIn);
                OutputStream stream = System.out;
                while(bytesRead != -1){
                     stream.write(readIn);
                     bytesRead = filesource.read(readIn);
            } catch (Exception e){
                e.printStackTrace();
         public static void main(String[] args){
              SearchXml();
    }it returns the contents of the xml perfectly
    <?xml version="1.0"?>
    <bulletList>
    <bullet type="1">
         <speed>1.0f</speed>
         <size>O.65f</size>
         <damage>1</damage>
         <texture>"res/shot.png"</texture>
         <sound>"blah.ogg"</sound>
    </bullet>
    <bullet type="2">
         <speed>1.5f</speed>
         <size>O.65f</size>
         <damage>1</damage>
         <texture>"res/shot.png"</texture>
         <sound>"blah.ogg"</sound>
    </bullet>
    </bulletList>Does a applet in a browser have somekind of weird restriction that I haven't heard of yet ?
    Edited by: Veko on Dec 8, 2008 2:28 AM
    Edited by: Veko on Dec 8, 2008 2:29 AM
    Edited by: Veko on Dec 8, 2008 2:29 AM

  • Testing SWF with external XML file, strange problem.

    Hi!
    My problem started after migration to 2.01. But I think it's
    not version problem.
    I have old project which uses external XML files ("
    http://www.mydomain.com/myxml.xml").
    When I teste project in "bin" folder it works perfect and SWF
    import data from XML.
    I created new Flex project and copied all scripts from old
    one. And my new app can't read external XML!!! (tested in "bin"
    folder):
    *** Security Sandbox Violation ***
    Connection to xmlURL halted - not permitted from
    file:///C:/myproject/bin/myproject-debug.swf
    BUT when I copy my new SWF to the old project "bin" folder
    then it WORKS! Strange!
    I found in Help "The Global Flash Player Trust directory" and
    I checked files: "flexbuilder.cfg", "flexbuilder.fbr" there are all
    my project paths (old and new).
    Thanks for help!
    newman

    You should your homework with Google and other search engines
    better ;)
    http://www.robrusher.com/1/2006/08/Flex-2-Error-with-XML.cfm

  • Read external XML stream into a field

    Hello all -
    I have been trying to get this working for a week now and still no luck. It seems like it's possible to find field values to external XML file, but Acrobat tries to parse the XML and be smart about it.
    I have a custom form logic that needs to read an XML file from a URL and assign the stream to a form field that can later be accessed via FormField.rawValue.
    The XML is rather basic - something like
    1
    2
    3
    4
    I tried the xfa.connectionSet to no avail. I am now trying to bring in that value with SOAP, but have been reading that it might give prompts in Reader.
    Can I simply read an external URL and assign the server response to a variable or a field ?
    My apologies for the super-basic question!!
    Thanks in advance!
    Frank

    I get the following error, probably means the file referenced is not available...
    SQL Error: ORA-22806: not an object or REF
    22806. 00000 - "not an object or REF"
    *Cause:    An attempt was made to extract an attribute from an item that is
    neither an object nor a REF.
    *Action:   Use an object type or REF type item and retry the operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to read an external XML file in a indesign Plugin?

    Hi All,
    Can you please guide in reading an external XML file in a indesign Plugin in MAC system. I am an windows user.We are using this file for reading some inputs.
    Thanks,
    Daniel

    Hello Daniel,
    I am uncertain about the actual question. If you are developing a plug-in or otherwise interfacing with the guts of ID, I suggest asking the question in the SDK forum:
    InDesign SDK Forum
    Otherwise, what is it you are wanting to know concerning importing XML into InDesign?
    Mike

  • Read external XML

    I'm using adobe designer 7 . I want to read external XML file with javascript
    there is a method XMLData.parse(String param1, Boolean param2) but it takes as parameter only string.
    How can I get external XML file convert it to string and pass it to XMLData.parse(param1, param2)?

    You are right there are more than one line in it. But the line which I posted above is the line which parse the string cXMLDoc
    Consider the XML document as first introduced in the example following the XMLData.applyXPath
    method.
    var x = XMLData.parse( cXMLDoc, false );
    var y = x.family.name; // An XFAObject
    console.println(y.value); // Output to console is "Robat"
    Get information about dad.
    y = x.family.dad.id; // An XFAObject
    console.println(y.value); // Output to console is "m2"
    y = x.family.dad.name.value; // y = "Bob"
    x.family.dad.name.value = "Robert"; // Change name to "Robert"
    y = x.family.dad.name.value; // y = "Robert"
    y = x.family.dad.personal.income.value; // y = "75000"
    x.family.dad.personal.income.value = "80000"; // Give dad a raise

  • IPhoto '11 problem downloading pix w/external card reader

    Lately my external card reader won't download pix to iPhoto. The device shows up on the desktop but not within iPhoto so no pictures are downloaded. Bought a new reader (Hoodman), but problem remains. Tried restarts, which sometimes works but now mostly doesn't. This only started happening sporadically a few months ago. The old card reader works just fine on my husband's iMac, so I don't think it's the card reader's fault. Anyone else having these problems? Or have a fix? I've got a bunch of pictures to get into iPhoto and am stymied. I'm on an iMac, Snow Leopard (10.6.8), using iPhoto '11 (v9.2.3).

    Thanks for the suggestion. But after creating that test library you suggested I still don't know how to get back to my original library when I launch iPhoto. Could you please guide me through that? I've never done this before and am nervous about the whereabouts of all those 1000s of pix I have (even tho I'm backed up w/Time Machine).
    By the way, I just noticed a similar discussion about a year ago with the identical problem, numerous reports of the external card driver suddenly not being recognized by iPhoto. Sounds like an unsolved, ongoing problem. Guess I need to file a report with Apple.

  • Help Required on Reading an External XML file in flex

    Hi Experts
    I want some help regarding flex.
    I want to read an external xml file in flex and want to show
    different datas in different components
    So bacically i need what is the procedure to call an external
    xml file and the procedure to catch the value of the xml tags and
    the option (options means ex: "id" or "type inside" "row" tag ) in
    side the xml file.
    Here is My xml file named "skn_organ.xml"
    <?xml version="1.0" encoding="UTF-8"?>
    <slide>
    <r>7</r>
    <c>8</c>
    <row id="A01" type="g">
    <organ>Skn</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="A02" type="g">
    <organ>Brt</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="A03" type="g">
    <organ>Spl</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="A04" type="g">
    <organ>Lnode</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="A05" type="g">
    <organ>Ske</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="A06" type="g">
    <organ>Lun</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="A07" type="g">
    <organ>Sgl</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="A08" type="g">
    <organ>Liv</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B01" type="g">
    <organ>Gal</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B02" type="g">
    <organ>Pan</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B03" type="g">
    <organ>Ton</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B04" type="g">
    <organ>Eso</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B05" type="g">
    <organ>Sto</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B06" type="g">
    <organ>Sto</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B07" type="g">
    <organ>Sbl</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B08" type="g">
    <organ>Col</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C01" type="g">
    <organ>Skn</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C02" type="g">
    <organ>Brt</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C03" type="g">
    <organ>Spl</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C04" type="g">
    <organ>Lnode</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C05" type="g">
    <organ>Ske</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C06" type="g">
    <organ>Lun</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C07" type="g">
    <organ>Sgl</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C08" type="g">
    <organ>Liv</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="D01" type="g">
    <organ>Gal</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="D02" type="g">
    <organ>Pan</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="D03" type="g">
    <organ>Ton</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    </slide>

    Hi sanjivsutar,
    Put your xml file under folder "assets", the application demo
    is as following
    ====================================================================
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    initialize="init()">
    <mx:Script>
    <![CDATA[
    private var mainXML:XML;
    private var loader:URLLoader;
    private function init():void {
    loader = new URLLoader();
    loader.addEventListener(Event.COMPLETE, onComplete);
    loader.load(new URLRequest('assets/skn_organ.xml'));
    private function onComplete(evt:Event):void {
    mainXML = new XML(loader.data)
    out.text += "xml loaded, using E4X syntax: \n\n";
    out.text += "Row 1: "+mainXML.row[0]+"\n"
    out.text += "Row 6: organ = "+mainXML.row[5].organ+"\n"
    out.text += "Row(id='D02'): link =
    "+mainXML.row.(@id=="D02").link+"\n"
    ]]>
    </mx:Script>
    <mx:TextArea id="out" width="400" height="300"/>
    </mx:Application>
    ======================================================================
    Jeffrey

  • How can I set connection to external XML file with Dreamweaver to buiild AIR app?

    Hello,
    I try to do simple AIR app in dreamweaver. It's not problem
    to use static data. But I'd like to use dynamic data from external
    XML file. I try to use Spry and evrything works fine in web browser
    but i have problem with loading external XML data into my app in
    AIR. Can I simply transform my spry based html app into AIR?
    What should I add to do this?
    Pawel

    Daniel Lichtenwald wrote:
    What are the requirements and steps for arranging to receive this large file using File Transfer Protocol (FTP)?
    Usually, we don't speak of "receive" when using FTP, since the file is transferred from server to client, so it's more of a case of "download".
    At your end, it's simple. You use an FTP client; under SL, that includes Finder and Safari, so you don't even need to get any additional software.
    At the other end, it's more complicated; the 'sender' must set up an FTP server on his machine.
    Alternatively, you can set up your own Mac as an FTP server, and have the 'sender' connect to you with an FTP client and upload the file; but, if your Mac lives behind a router, then you have more work to do with the router settings.
    That's why it's much easier to use the file sharing services mentioned above -- if they are available in both sender's and receiver's locations. (Keep in mind that some countries block access to all those mentioned -- except perhaps <www.transfer.ro>, of which I know absolutely nothing.)

  • _blank link in external xml generates pop up blocker

    I have links that are read into an html formatted text field
    from an external xml file. My problem is that I would like the link
    to load a new browser window when clicked using _blank - but that
    generates pop up blocker in firefox.
    I've tried passing the link to a function in flash to do the
    same thing , but no luck with that.
    The links all work OK (as soon as I put _self in it performs
    as expected)
    Does anyone know a solution to this problem
    thanks

    you could try using javascript to open the popup and see if
    your popup blocker is less sensitive about that. you would use the
    externalinterface class in flash to communicate between
    actionscript and javascript.

  • External XML files in Flash iPhone apps

    Hi everyone. I know that apple has loosened up on what is and isn't allowed on the app store these days, such as flash. I was thinking of writing an app that would call upon a web based xml file to call up pictures to display in the iPhone.
    I know Apple doesn't allow apps that call upon external scripts but it's not an executable script, its a list of images and where they are stored. Does anybody have any input on whether Apple may have a problem with this?
    Cheers

    don't know.
    I'm not sure of the differences between actionscript in flash and javascript in the browser but you could call for an XML file to be sent as json data from the script if accessing external XML files directly is not allowed.
    Problem is that XML can contain anything you want it too... it could contain a script itself.

  • 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!

  • Flex/Actionscript External XML Scope Issue

    I am processing an external XML file in an event listener
    after the URLLoader is complete. The issue I'm having is that I
    want getProduct() to return the XML data. How can I get the data
    from the event listener getXML(). I tried creating a public
    variable outside of the functions but I can't access it from within
    the two functions.
    package messages
    import flash.events.Event;
    import flash.net.*;
    //Returns the current product
    public class FetchXMLData
    public static function getXML(e:Event):void {
    var myProduct:XML = new XML(e.target.data);
    trace(myProduct.product);
    public static function getProduct():XML{
    var loader:URLLoader = new URLLoader();
    loader.addEventListener(Event.COMPLETE,
    FetchXMLData.getXML);
    loader.load(new URLRequest("
    http://www.example.com/api"));
    var myProducts:XML = new XML();
    //get the value from the listener?!
    return myProducts;
    }

    I'm also running into this problem.  I'm running on Eclipse 3.4 w/ the WBEJ_plugin 3.2.
    Everyon else using this application isn't have a problem saving and the encoder doesn't mess up their SOAP requests, but each time I send, SOAP double-encodes the &, resulting in the error you described.  The problem I was running into was then dealing w/ that XML on a return SOAP, where I'm expecting well formed XML, and instead I get &amplt;WhateverName&gt;, which Flex reinterprets as &lt;, and not <.  I made an ugly hack for that that will just split/join any of those, but if there is a real reason why this is happening, that would be great to find out.

  • Form with dropdown lists using external XML data - Distribution

    Hi all,
    I have created a form which has a series of drop down lists that populate dynamically from an external XML file. The option selected in the first list determines what data can be selected in the second, and so on.
    This functionality worked well within designer when I previewed the form - the problem I have is when I go to distribute. I (perhaps mistakenly) assumed that when I distributed the form, the external XML file would be absorbed into the main PDF, but this as not the case. Not only that, even if the XML file is in the same location as the published PDF, the dropdowns no longer populate with any data.
    Am I doing something wrong? Is there a setting to draw in external XML when a form is published? Is there another method to dynamically populate dropdowns that will provide me with a single PDF as a final product?
    Cheers,
    Lachlan.

    Hello Lachlan,
    Before distributing the form have you opened that form in Acrobat and imported the XML and saved it ?
    Thanks.
    Bibhu.

  • Media files prevent Flash from fully loading external XML file

    Im trying to debug a flash widget we created, and it loads
    fine on the 20 odd computers we tested on EXCEPT for one computer
    where, the application doesn't load an external XML file that calls
    for 3 small mp3 files and a FLV file to load as well.
    In a debugger, we noticed that when it tried to load these
    mp3 files it was getting a Forbidden access message. The FLV just
    prevents the FLV player from showing up at all (not even the skin).
    Can anyone figure out why, that it would work over all the
    other computers and NOT the one? On that person's computer, we
    tried it in IE, Firefox, even Chrome and the application doesn't
    load. We even cleared the cache, did a hard refresh and still
    nothing.
    However, the other computers work just fine.
    ALL the computers have the latest Flash software installed.
    What could cause this problem?

    Actually what worked was removing 'xmldoc' from the php script. So $data =$GLOBALS["HTTP_RAW_POST_DATA"]; instead of $data = xmldoc($GLOBALS["HTTP_RAW_POST_DATA"]);
    Couldn't find anything about 'xmldoc'. Is it used for anything in php?
    Anyway, the loading error went away, but then I got into problems with getting the return echoed values back. The textfield stayed empty even when saving the data.txt file worked.
    I then placed the <stuff> tags between <root> tags and then flash got the sentences between the <stuff> tags back. Why does Flash need the returned xml output to be between <root> tags for it to see the content between the <stuff> tags? So why do I need to use echo("<root><stuff>Server unable to create file.</stuff></root>"); instead of cho("<stuff>Server unable to create file.</stuff>");?

Maybe you are looking for