[flexcoders] Why is node name folder and value file under folder

2005-09-17 Thread flex_dba
I have an xml file that I'm binding to a tree control as a result of 
an httpService call. I'm having a hard time understanding why if my 
xml is like this:


 
  Jane
  Tarzan
 


   In the tree control it shows parent as a folder, cool. But it also 
shows sister & brother as folders with Jane & Tarzan as files in that 
folder. They are the root level nodes, why are they represented as 
folders with thier data as children.

Anyway to fix this I figured I'd write a function to add the nodes to 
the tree by giving it a label that I want and the data that I need. 
But it's not working:

function getNameValuePairs(event:Object) 
{

var aLabel
var aDataItem

for( i in event.result)
{

aLable = i.target.selectedItem
[i].attributes.label;
aDataItem = i.target.selectedItem
[i].firstChild.nodeValue;
myTree.addTreeNode(aLable, aDataItem);

}
}







 Yahoo! Groups Sponsor ~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Flex Actionscript firstChild & nextSibling

2005-09-13 Thread flex_dba
I'm trying to send back the response from a webservice and populate 
a tree control with the results. I don't want to have to hardcode 
the element names to be able to retrieve  the values. I saw 
firstChild & nextSibling in a Flash2004 tutorial and was wondering 
if these are also available in Flex. Probably just using them wrong 
but when I display the value I'm getting undefined. This is the 
snippet I'm working with:


function addNodesToTree(response)
{
if (response.nbta.pb!=null)
{
displayQuestion.text = response.firstChild.nodeValue;
}
else if(response.nbta.cs!=null)
{
displayQuestion.text = 
response.nextSibling.nodeValue;
}
else if(response.nbta.es!=null)
{
displayQuestion.text = "ES";
}


The last one works, which I  just just using to test if I got the 
correct response.

Thanks in advance!







 Yahoo! Groups Sponsor ~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/