A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: FLEX Tree Component from XML

  1. #1
    Member
    Join Date
    Jul 2008
    Posts
    94

    FLEX Tree Component from XML

    Hiya,

    I'm trying to use the tree component in conjunction with a php page I have that produces xml. But I am literally struggling so much its ridiculous*.

    My php page is printing out this:

    Code:
    <?xml version='1.0' encoding='utf-8'?>
    <folders> 
    <dir name='Food'> 
    <dir name='Meat'> 
    	<dir name='Steak'/> 
    </dir> 
    <dir name='Vegetables'> 
    	<dir name='Potato'/> 
    	<dir name='Sweed'/> 
    </dir> 
    </dir> 
    <dir name='Electrics'> 
    	<dir name='Hifi'/> 
    	<dir name='ipod'/> 
    </dir> 
    </folders>
    Could anyone just copy and paste some mxml in their response to create a tree structure from that? I know that must seem so lazy, but I've been at this for weeks, and I've had loads of [object][object] things, loads of blank trees, loads of swf's that never load!!! I'd literally help you out in any way I could - I'm sure you are all pros compared to me so this is worthless, but I have a nice bit of php which will create the nested xml structure above from a table full of folders stored side by side.

    Any help in any form always appreciated!

    Thanks, Dave

    *I think this is because the debug version of flash player I'm using is constantly wrong despite the fact I keep updating it, so trying to look at what the HTTPService returns is pretty much impossible/guesswork!

  2. #2
    Member
    Join Date
    Jul 2008
    Posts
    94
    oh god I'm sorry flash kit, I think in a moment of weakness I stopped persevering. I did it. Thank god. I did it.
    Just because I hate finding threads with no resolution on the bottom, this is what I did:

    PHP Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="treeXML.send()">
        <mx:HTTPService id="treeXML" url="http://localhost/upload/xml.php" resultFormat="e4x" />
        <mx:Tree y="24" width="196" horizontalScrollPolicy="auto" height="281" id="mytree" dataProvider="{treeXML.lastResult.dir}" horizontalCenter="0" labelField="@name"/>
        <mx:Button y="313" label="Update" click="treeXML.send()" horizontalCenter="0"/>
    </mx:Application>

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center