Videophone example, XML result into a list?


in video phone application, reg.cgi appears ouput list of 'friends' in xml format


(from regcgi)

for f in friends:
    print "\t<friend>\n\t\t<user>%s</user>" % (xml.sax.saxutils.escape(f), )
    c = db.cursor()
    c.execute("select m_username, m_identity registrations m_username = ? , m_updatetime > datetime('now', '-1 hour')", (f, ))
    result in c.fetchall():
        eachident = result[1]
        if not eachident:
            eachident = ""
        print "\t\t<identity>%s</identity>" % (xml.sax.saxutils.escape(eachident), )
        if f != result[0]:
            print "\t\t<registered>%s</registered>" % (xml.sax.saxutils.escape(result[0]), )
    print "\t</friend>"

 

and flash app appears results follows

 

(from httpmanager)

else if (result.result.hasownproperty("friend"))
                {
                    // party query response
                    remote = result.result.friend object;
                    if (remote.hasownproperty("user") && remote.hasownproperty("identity"))
                    {
                        var identitystring:string = remote.identity
                        var userstring:string = remote.user;
                       
                        var r:idmanagerevent = new idmanagerevent("lookupsuccess", userstring, identitystring);
                        dispatchevent(r);
                    }

 

 


and places call 1 of 'friends' follows

 

(from videophone app file)

else if (e.type == "lookupsuccess")
                {
                    // party query response
                    var i:idmanagerevent = e idmanagerevent;
                   
                    placecall(i.user, i.id);   
                }

 

 

my query is, how take full list returned xml, , example, populate list data?

how iterate through list, extracting required values , put them list?

 

im new flash, , trying head around how these simple things...

 

can shed light, im learning loads, keep hitting struggling points dont have clue how flash these things, , dont know investigate... once pointer in right direction given,  small example shown, can take there, , investigate/learn more.

 

t

read on e4x in flex. makes short work of xml tasks.



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Using Arduino Uno R3 to bootload the atmega328-PU (non pico)

localhost/joomla15/administrator doesnt work - Joomla! Forum - community, help and support

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??