all groups > flash actionscript > march 2007 >
You're in the

flash actionscript

group:

Accessing XML Tree in flash



Accessing XML Tree in flash Non-nelson
3/31/2007 4:17:14 PM
flash actionscript: Hi all,

I am in the process of learning about XML & I like to find out how can i
access the XML Tree as shown
http://www.permadi.com/tutorial/flashXMLNewsExample/images/this_node.gif

Appreciate any help rendered that will help aid my learning process,thanks...
:smile;
Re: Accessing XML Tree in flash abeall
3/31/2007 4:41:53 PM
Re: Accessing XML Tree in flash Non-nelson
3/31/2007 5:09:24 PM
Yeah, i did read that and I did set up a breakpoint at the line but to no
avail,nothing comes up on the debugger...
Is it inserted it at the wrong line?

function processXMLData(success) <------- [b]BREAKPOINT HERE[/b]
{
if (success)
{
var rootNode=this.firstChild;

var headerNode=findNode(rootNode, "header");
header=getValue(headerNode);

var contentNode=findNode(rootNode, "content");
content=getValue(contentNode);

var authorNode=findNode(rootNode, "author");
author=getValue(authorNode);


/*
var newsNode=this.firstChild;
var headerNode=newsNode.childNodes[0];
var contentNode=newsNode.childNodes[1];
var infoNode=newsNode.childNodes[2];
var authorNode=infoNode.childNodes[1];

header=headerNode.firstChild.nodeValue;
content=contentNode.firstChild.nodeValue;
author=authorNode.firstChild.nodeValue;
*/
}
else
{
content="Today's news is not found";
}
}

function getValue(node)
{
if (node && node.firstChild)
return node.firstChild.nodeValue;
return "";
}

Much Thanks...
Re: Accessing XML Tree in flash kwyjibo12ret
3/31/2007 5:30:26 PM
hello non-nelson, do you know what this long piece of code above does?
Re: Accessing XML Tree in flash Non-nelson
4/1/2007 12:00:00 AM
Hi,
very briefly, this piece of code is only a segment of what needs to be done
in the case client "mess" up the node in the .xml files and is a function
performed after .xml is loaded. Me too am in the process of learning about
xml, look http://www.permadi.com/tutorial/flashXMLNewsExample/ for more!

x Still trying to find out how to use breakpoint to view XML TREE x
Re: Accessing XML Tree in flash abeall
4/1/2007 12:00:00 AM
Breakpoint looks like it's in the right place, just do Control > Debug Movie,
hit play, then it will break on that code and you can click the Variables tab,
and it should show you the XML tree in there somewhere.
AddThis Social Bookmark Button