2 Replies Latest reply on Sep 4, 2006 2:14 AM by x______jan

    Tree with external XML

    x______jan
      Hi,
      there are many nice and easy tutorials how to populate a Tree with a XMLList, which is inside the same mxml.
      But i have a deeply nested xml file which gets loaded (via HTTPService?) and want to give that to the Tree as its dataProvider.

      Cant get it to work and cant find any tutorial on that.
      Can someone please help?
      thx.
        • 1. Re: Tree with external XML
          CoolCountDracula
          quote:

          Originally posted by: x______jan
          Hi,
          there are many nice and easy tutorials how to populate a Tree with a XMLList, which is inside the same mxml.
          But i have a deeply nested xml file which gets loaded (via HTTPService?) and want to give that to the Tree as its dataProvider.

          Cant get it to work and cant find any tutorial on that.
          Can someone please help?
          thx.



          post the code and xml file will c wats wrong with it
          • 2. Re: Tree with external XML
            x______jan Level 1
            Thanx a lot CoolCount,

            its fixed. I didnt use the XML object, i tried it with the HTTPService object...
            thanx alot for your help offer.

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
            <mx:Script>
            <![CDATA[

            private var loader:URLLoader;

            [Bindable]
            private var xml:XML;

            private function init():void
            {
            var xml:XML = new XML();
            loader = new URLLoader(new URLRequest("external.xml"));
            loader.addEventListener(Event.COMPLETE, handleEvent);
            }

            private function handleEvent(e:Event):void
            {
            xml = XML(URLLoader(e.target).data);
            }

            ]]>
            </mx:Script>
            <mx:Tree x="20" y="20" height="371" width="247" id="myTree" labelField="@a" dataProvider="{xml}"></mx:Tree>
            </mx:Application>