PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
AS 2 How can I load this xml file into flash?
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: How can I load this xml file into flash?

Hybrid View

  1. #1
    Member
    Join Date
    Sep 2010
    Posts
    73

    How can I load this xml file into flash?

    Code:
    <?xml version="1.0"?>
    <root>
    <0>
    <data>
    <0>
    <id>100002678639121</id>
    <name>Rob Puckett</name>
    <first_name>Rob</first_name>
    <last_name>Puckett</last_name>
    <picture>http://profile.ak.fbcdn.net/hprofile-ak-ash2/273357_100002678639121_1965699565_q.jpg</picture>
    </0>
    </data>
    </0>
    </root>
    Actionscript Code:
    stop();


    function Get_FaceBook_Friedns_Xml(loaded)
    {
        if (loaded)
        {
            //Get Facebook User Id
            fbId = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
            _level0.Site.GetFriends.Id.text = fbId;
            //Get Facebook User Name
            fbName = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
            _level0.Site.GetFriends.Name.text = fbName;
            //Get Facebook User First Name
            fbFirst_Name = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;
            _level0.Site.GetFriends.First_Name.text = fbFirst_Name;
            //Get Facebook User Last Name
            fbLast_Name = this.firstChild.childNodes[0].childNodes[3].firstChild.nodeValue;
            _level0.Site.GetFriends.Last_Name.text = fbLast_Name;
           
            //Get Facebook User Verified
            fbPicture = this.firstChild.childNodes[0].childNodes[6].firstChild.nodeValue;
            _level0.Site.GetFriends.Picture.text = fbPicture;
           
           
           
        }
               
        else
        {
            content = "file not loaded!";
           
        }

    }
    Get_FaceBook_Friedns_Xml_Data = new XML();
    Get_FaceBook_Friedns_Xml_Data.ignoreWhite = true;
    Get_FaceBook_Friedns_Xml_Data.onLoad = Get_FaceBook_Friedns_Xml;
    Get_FaceBook_Friedns_Xml_Data.load("http://claritydreams.com/facebook/get/friends.php");
    WiiStream A Social Movie Network Version 0.1.1 Demo Testers Aproved http://wiistream.net/WiiStream.exe

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Send FLA file!
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Member
    Join Date
    Sep 2010
    Posts
    73
    NVM I got it
    WiiStream A Social Movie Network Version 0.1.1 Demo Testers Aproved http://wiistream.net/WiiStream.exe

  4. #4
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    loading it live gives some strange results... (maybe need to use a proxy script?)

    anyways locally works fine:

    actionscript Code:
    Get_FaceBook_Friedns_Xml_Data = new XML();
    Get_FaceBook_Friedns_Xml_Data.ignoreWhite = true;

    Get_FaceBook_Friedns_Xml_Data.onLoad = function() {
        var rootNode = Get_FaceBook_Friedns_Xml_Data.childNodes[0]
       
        //Get Facebook User ID
        var fbId = rootNode.childNodes[0].childNodes[0].childNodes[0].childNodes[0].firstChild.nodeValue;
        //Get Facebook User Name
        var fbName = rootNode.childNodes[0].childNodes[0].childNodes[0].childNodes[1].firstChild.nodeValue;
        //Get Facebook User First Name
        fbFirst_Name = rootNode.childNodes[0].childNodes[0].childNodes[0].childNodes[2].firstChild.nodeValue;
        //Get Facebook User Last Name
        fbLast_Name = rootNode.childNodes[0].childNodes[0].childNodes[0].childNodes[3].firstChild.nodeValue;
        //Get Facebook User Verified
        fbPicture = rootNode.childNodes[0].childNodes[0].childNodes[0].childNodes[4].firstChild.nodeValue;
       
        trace("FB ID: "+fbId+newline+"FB NAME: "+fbName+newline+"FB FIRST: "+fbFirst_Name+newline+"FB LAST: "+fbLast_Name+newline+"FB PIC: "+fbPicture);
    };

    //Get_FaceBook_Friedns_Xml_Data.load("http://claritydreams.com/facebook/get/friends.php");
    Get_FaceBook_Friedns_Xml_Data.load("data.xml");

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