Mailing List
Home
Forum Home
Flash Pro
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
XML Root Node in Tree Component - SOLVED

XML Root Node in Tree Component - SOLVED

2004-03-12       - By Keith L. Miller

 Back
Thanks, that worked perfectly!

-- -- Original Message -- --
From: "Jim Cheng" <jim@(protected)>
To: <flashcoders@(protected)>
Sent: Friday, March 12, 2004 9:43 AM
Subject: Re: [Flashcoders] XML Root Node in Tree Component


> Keith L. Miller wrote:
>
> > But, in the Tree component, that is exactly what I want to show.  I do
not
> > want an individual item showing up that I have to expand to get to the
rest
> > of the data.  How can I add a "root" node like this:
> >
> > <root>
> >    <folder label="folder_1">
> >       <file label="file_1_1" />
> >       <file label="file_1_2" />
> >    </folder>
> >    <folder label="folder_1">
> >       <file label="file_2_1" />
> >       <file label="file_2_2" />
> >    </folder>
> > </root>
>
> Try removing the root node from the tree and then reinserting each
> of it's children back into the tree.  This works for me:
>
> <code>
>
>      // Attach the XML data provider
>      myTree.dataProvider = myXML;
>
>      // Remove the root node from the tree object
>      var node = myTree.removeTreeNodeAt(0);
>
>      // Reinsert each of the root node's children in the tree
>      var n;
>
>      while (n = node.firstChild) {
> myTree.addTreeNode(n);
>      }
>
> </code>
>
> Jim
>
> =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
> 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:106759
> =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
> To unsubscribe send a blank e-mail to:
> Normal Mode: flashcoders-unsubscribe@(protected)
> Digest Mode: flashcoders-digest-unsubscrive@(protected)


=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
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:106766
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)