  | |  | Flash Shortcutting my XML | Flash Shortcutting my XML 2004-03-11 - By Mark Mulhollam
Back As for this problem, try using this
myTree.dataProvider = myTreeDP.firstChild;
It may work depending on the structure of your xml (with a root node) - it works perfectly for me.
Mark Minneapolis, Minnesota
-- --Original Message-- -- From: Keith L. Miller [mailto:millerk@(protected)] Sent: Thursday, March 11, 2004 1:21 PM To: flashcoders@(protected) Subject: Re: [Flashcoders] Flash Shortcutting my XML
That's a good idea. I'll play with that concept. One other item of note (just for others searching for similar issues) that I've found is that in my onLoad function I set the dataProvider of myTree equal to the incoming XML as such:
myXML.load("somefile.xml"); myXML.onLoad = function (){ myTree.dataProvider = myXML; }
where somefile.xml is:
<item label="SubFolder1"> <item label="Cursors"></item> <item label="SubFolder2"> <item label="SubFolder3"></item> </item> </item>
That produces the problem we've been discussing. Using the method I explained about changing the leaf icon works except that the disclosure icon ( + or - ) does not show up. However, the following code produces the correct results in the tree (disclosure icon and all):
var newXML = new XML("<item label=\"New Folder\"></item>"); newNode = mainNode.addTreeNode(newXML.firstChild);
OR
var newXML = new XML("<item label=\"New Folder\" />"); newNode = mainNode.addTreeNode(newXML.firstChild);
So it seems that adding a node with the </item> or the <item label="New Folder" /> tags works fine using the addTreeNode function, but assigning the XML using dataProvider does not.
I'm going to try just looping through the XML adding each node individually. That should work, but I'm not sure of the speed in which I will be able to accomplish what I'm trying to do especially when there are hundreds of nodes I'm dealing with.
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Supported by Fig Leaf Software =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Be sure to check the archives and the wiki: http://chattyfig.figleaf.com/ =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:106700 =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- To unsubscribe send a blank e-mail to: Normal Mode: flashcoders-unsubscribe@(protected) Digest Mode: flashcoders-digest-unsubscrive@(protected)
Earn $52 per hosting referral at Lunarpages.
|
|
 |