A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: dynamic XMLList

  1. #1
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429

    dynamic XMLList

    I'm trying to dynamically create the sample below:
    Code:
        <mx:XMLList id="employees">
            <employee>
                <name>Christina Coenraets</name>
                <phone>555-219-2270</phone>
                <email>ccoenraets@fictitious.com</email>
                <active>true</active>
            </employee>
            <employee>
                <name>Joanne Wall</name>
                <phone>555-219-2012</phone>
                <email>jwall@fictitious.com</email>
                <active>true</active>
            </employee>
        </mx:XMLList>
    I have this tag in my mxml:
    <mx:XMLList id="results">

    </mx:XMLList>

    For some reason, Flex will not allow you to use .appendChild() unless there is already one tag. That means I'd have to do this:
    <mx:XMLList id="results">
    <resultList>
    </resultList>
    </mx:XMLList>

    to get it to work which means I'd end up with something like this:
    Code:
        <mx:XMLList id="employees">
          <resultList>//I dont want one big wrapping tag
            <employee>
                <name>Christina Coenraets</name>
                <phone>555-219-2270</phone>
                <email>ccoenraets@fictitious.com</email>
                <active>true</active>
            </employee>
            <employee>
                <name>Joanne Wall</name>
                <phone>555-219-2012</phone>
                <email>jwall@fictitious.com</email>
                <active>true</active>
            </employee>
       </resultList>
        </mx:XMLList>
    Atm, I'm taking a delimited string sent from PHP. I'm using .split() and a for loop to create a multidimensional array that I intend on populating the XMLList with. (ie. results.row[i] = myArray[i][0]; )

    Am I way off on this?

  2. #2
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    Holy carp, I am way over complicating this. Kinda hating flex right now, if I didnt need the built in sorting ability of the datagrid, I'd have knocked this out in flash 8 in about 20 minutes.

    Anyway, found this great article (thanks to gSOLO) for connecting with PHP.
    http://www.adobe.com/devnet/flex/art...x2_php_03.html

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