Lets enhance the last example by adding two buttons to open and close all tree nodes
Add the following code to the first frame
Add two push button (v2) components to the document and label them “Open All” and “Close All”
write the following code for “Open All” button
?Add two push button (v2) components to the document and label them “Open All” and “Close All”
write the following code for “Open All” button
write the following code for “Close All” button
on (click) { _parent.openOrCloseAll (_parent.sample_xml.firstChild, false); } |
It is very important to pass the firstChild instead of the xml itself for “Close All” otherwise tree root node itself will be closed (there will be no visible tree nodes)