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
 
NEVERMIND Tree component

NEVERMIND Tree component

2004-02-27       - By Brook Davies

 Back
Reply:     1     2     3  

Nevermind, I  found some alternate code - I guess theres a bug in that code
from the mm Tut.

Brook

At 01:38 PM 2/27/2004, you wrote:

>Hello,
>
>I am trying to get a tree component to 'show up'. I copied and pasted the
>code from this article
>http://www.macromedia.com/devnet/mx/trio/articles/tree_control03.html,
>(See below) and dragged a tree component onto the stage and named it
>'myTree_tree'.
>
>When I test this, nothing shows up, just the empty listbox thing. I traced
>the tree component and it returned a reference to it - so its named correctly.
>
>Does anyone have any very simple tree code that I can test just to get the
>tree to 'show up' ?
>
>Brook
>
>
>// This code will create a simple, static tree.
>
>// Set the root node to display "Parts List" and be initially open.
>// To do this we create a new tree node object in a variable called //
>'myRootNode' and then pass it to myTree_tree through the
>// setRootNode() method of the Tree Control component.
>var myRootNode = new FTreeNode("Parts List").setIsOpen(true);
>myTree_tree.setRootNode(myRootNode);
>
>// Next set the first parent node by creating another node object
>// in a variable called 'parentnode1' and passing it to myRootNode
>// through the addNode() method of the Tree Control component.
>var parentnode1 = new FTreeNode("All Wheel Drive","parentnode1data");
>myRootNode.addNode(parentnode1);
>
>// We'll repeat the process to create a child node, passing the node
>// object to the parentnode1 we just created.
>var childnode1 = new FTreeNode("Axel Shaft","childnode1 data");
>parentnode1.addNode(childnode1);
>
>// The next two addNode() routines simply repeat the procedure above
>// to build out the tree with more parts.
>var parentnode2 = new FTreeNode("Cooling","parentnode2 data");
>myRootNode.addNode(parentnode2);
>
>var childnode2 = new FTreeNode("Pump Block","childnode2 data");
>parentnode2.addNode(childnode2);
>
>// Finally, we need to refresh the tree to display the node we created.
>myTree_tree.refresh();

<html>
<body>
Nevermind, I&nbsp; found some alternate code - I guess theres a bug in
that code from the mm Tut.<br><br>
Brook<br><br>
At 01:38 PM 2/27/2004, you wrote:<br><br>
<blockquote type=cite class=cite cite>Hello, <br><br>
I am trying to get a tree component to 'show up'. I copied and pasted the
code from this article
<a href="http://www.macromedia.com/devnet/mx/trio/articles/tree_control03.html"
eudora="autourl">http://www.macromedia.com/devnet/mx/trio/articles/tree
_control03.html</a>,
(See below) and dragged a tree component onto the stage and named it
'<font size=2>myTree_tree'.<br><br>
</font>When I test this, nothing shows up, just the empty listbox thing.
I traced the tree component and it returned a reference to it - so its
named correctly. <br><br>
Does anyone have any very simple tree code that I can test just to get
the tree to 'show up' ?<br><br>
Brook<br><br>
<br>
<font size=2>// This code will create a simple, static tree. <br><br>
// Set the root node to display &quot;Parts List&quot; and be initially
open. <br>
// To do this we create a new tree node object in a variable called //
'myRootNode' and then pass it to myTree_tree through the <br>
// setRootNode() method of the Tree Control component. <br>
var myRootNode = new FTreeNode(&quot;Parts List&quot;).setIsOpen(true);
<br>
myTree_tree.setRootNode(myRootNode); <br><br>
// Next set the first parent node by creating another node object <br>
// in a variable called 'parentnode1' and passing it to myRootNode <br>
// through the addNode() method of the Tree Control component. <br>
var parentnode1 = new FTreeNode(&quot;All Wheel
Drive&quot;,&quot;parentnode1data&quot;);<br>
myRootNode.addNode(parentnode1); <br><br>
// We'll repeat the process to create a child node, passing the
node<br>
// object to the parentnode1 we just created. <br>
var childnode1 = new FTreeNode(&quot;Axel Shaft&quot;,&quot;childnode1
data&quot;);<br>
parentnode1.addNode(childnode1); <br><br>
// The next two addNode() routines simply repeat the procedure
above<br>
// to build out the tree with more parts. <br>
var parentnode2 = new FTreeNode(&quot;Cooling&quot;,&quot;parentnode2
data&quot;); <br>
myRootNode.addNode(parentnode2); <br><br>
var childnode2 = new FTreeNode(&quot;Pump Block&quot;,&quot;childnode2
data&quot;); <br>
parentnode2.addNode(childnode2); <br><br>
// Finally, we need to refresh the tree to display the node we created.
<br>
myTree_tree.refresh();</font></blockquote></body>
</html>