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
Xml
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Xml

  1. #1
    Member
    Join Date
    Aug 2008
    Posts
    33

    Question Xml

    Hi there

    I have xml document contains data.My flash document also shows the data inside xml file.Now I need it to be dynamic and work dynamically.I need when I manually add an item at the end of "XML" file, it appears in flash document.


    Thanks

  2. #2
    Member
    Join Date
    Mar 2007
    Posts
    79
    From what I can gather from what you said, you've duplicated the xml data from the file and put it in your flash document.
    You do not need to do this.
    You can load the xml directly into the document.

    Actionscript Code:
    var myXML:XML = new XML();
    myXML.ignoreWhite = true;
    var xmlItems:Array = new Array();

    myXML.onLoad = function(success:Boolean) {
        if (success) {
    mxlcount = this.firstChild.*.length;
    for (i=0; i<xmlcount; i++) {
            xmlItems[i] = this.firstChild.childNodes[i].firstChild.nodeValue; //this depends on your xml layout.
            }
    }
    } else {
    trace ("Error loading XML document");
    }
    myXML.load("xmldocument.xml");

    From here you can now use the data array for your needs.
    There are also plently of xml tutorials out there which will be much more help than I am.

  3. #3
    Member
    Join Date
    Aug 2008
    Posts
    33
    Hi Vinchenzision.
    Thank you very much, it works.

    WIth regards

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