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
Selecting XML node
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Selecting XML node

  1. #1
    Senior Member
    Join Date
    Sep 2007
    Location
    UK
    Posts
    194

    Question Selecting XML node

    Anyone help with this?

    I have a ComboBox on screen which sends through a variable to select which node I need to see the details for, these details then populate a DataGrid within a Window component But no matter what I try, it never gives me the any results except the first.

    Actionscript Code:
    var xml:XML = new XML();
    xml.ignoreWhite = true;
    xml.load("Event1.xml");
    var dgArray:Array = new Array();
    xml.onLoad = function() {
        var nodes:Array = this.firstChild.firstChild.childNodes;
        for (var i:Number = 0; i<nodes.length; i++) {
            dgArray.addItem({Date:nodes[i].attributes.mydata, Title:nodes[i].attributes.mylabel, Duration:nodes[i].attributes.myduration, Outline:nodes[i].firstChild.nodeValue});
        }
    };
    myDGrid.dataProvider = dgArray;
    stop();

    Any help would be greatly appreciated. The numerical variable is called
    Actionscript Code:
    _root.selectedEvent
    and changes only when a different value is selected from the ComboBox.

    Mike

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Code:
    var xml:XML = new XML();
    xml.ignoreWhite = true;
    xml.load("Event1.xml");
    var dgArray:Array = new Array();
    xml.onLoad = function() {
    	var nodes:Array = xml.firstChild.childNodes[_root.selectedEvent].childNodes;
    	for (var i:Number = 0; i<nodes.length; i++) {
    		dgArray.addItem({Date:nodes[i].attributes.mydata, Title:nodes[i].attributes.mylabel, Duration:nodes[i].attributes.myduration, Outline:nodes[i].firstChild.nodeValue});
    	}
    	myDGrid.dataProvider = dgArray;
    };

  3. #3
    Senior Member
    Join Date
    Sep 2007
    Location
    UK
    Posts
    194

    resolved

    Many thx

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