09-20-2002, 07:15 PM
|
#1
|
|
Senior Member
Join Date: Oct 2001
Location: Fiji
Posts: 187
|
[AS1] Tree Component (set 2).
Hi !
I don't know how to use the Tree Component of Macromedia Flash UI component set 2.
I tried some examples in the Help but it do not work...:-(
Can someone post me an example of a complete script that I can use ? (a script using
cool functions!!)
Thank you.
Mathieu
P.S. It's strange that there is no Flash UI Label component in Flash MX (like in Visual Basic)...
Is there such a component somewhere on the web ?
|
|
|
10-28-2002, 10:07 PM
|
#2
|
|
Nxovkn
Join Date: May 2002
Location: Chattanooga, TN
Posts: 37
|
There is a label symbol but it is used within the components of the mentioned component set. You can find it in your library in the developer only area. Called FLabelSymbol.
You can alternatively use the TextField component which is built into Flash MX. The FLabelSymbol uses an embedded TextField component. Look up TextField in your actionscript dictionary.
As for how to use the tree, look in your 'References' section, all the methods for the TreeView are there.
|
|
|
10-29-2002, 02:22 PM
|
#3
|
|
Senior Member
Join Date: Oct 2001
Location: Fiji
Posts: 187
|
I know about the reference panel, but I can't build the tree. Here is Macromedia code :
(I simply dragged an instance of the Tree component on the stage and called it myTree)
var obj1 = new Object();
obj1["fruitType"] = "banana";
obj1["deliciousness"] = 100;
var obj2 = new Object();
obj2["fruitType"] = "lemon";
obj2["deliciousness"] = 2;
var fruits = new Array();
fruits.push(obj1);
fruits.push(obj2);
myTree.setDataProvider(fruits, "fruitType", "deliciousness");
myTree.setEnabled(true)
myTree.setSize(200,100)
myTree.refresh();
|
|
|
11-05-2002, 05:34 PM
|
#4
|
|
Nxovkn
Join Date: May 2002
Location: Chattanooga, TN
Posts: 37
|
var obj1 = new FTreeNode();
obj1.setLabel("banana");
obj1.setData(100);
obj1.fruitType = "banana";
obj1.deliciousness = 100;
var obj2 = new FTreeNode();
obj2.setLabel("lemon");
obj2.setData(2);
obj2.fruitType = "lemon";
obj2.deliciousness = 2;
// NOW Add the nodes manually.
myTree.addNode(myTree.getRootNode(), obj1);
myTree.addNode(myTree.getRootNode(), obj2);
// OR You can use the setDataProvider like this.
var fruits = new Array();
fruits.push(obj1);
fruits.push(obj2);
myTree.setDataProvider(fruits, "fruitType", "deliciousness");
myTree.setSize(200, 100);
// Can place this but I think refresh() is only needed if you
// manipulate the tree after it has been drawn the first time.
// Also enabled defaults to true so don't think you need it either.
myTree.setEnabled(true)
myTree.refresh();
/*
** Personally I have never used the DataProvider method but
** your code you posted looked right for it save for a few missing
** semi-colons. If you create FTreeNode objects rather then
** plain objects then you can add them in directly with
** myTree.addNode(). Also the label and data are set using the
** setter methods setLabel() and setData().
**
** I have used the FTree component successfully with XML
** streams without using the DataProvider route, you just have
** to set up your recursive loops correctly.
*/
Last edited by Sameal; 11-05-2002 at 05:38 PM.
|
|
|
11-10-2002, 03:52 PM
|
#5
|
|
Senior Member
Join Date: Oct 2001
Location: Fiji
Posts: 187
|
Thank you, but...I still have a problem...
I dragged an instance of the FTreeSymbol on the stage
and called it "myTree". Then I copied your script on
frame 1... but nothing happened !!!
Is it supposed to be more complex ?!?
I tried a lot of possibilities, using refresh(), setEnabled (true) and so on...
This component is driving me creazy !! Can I have your FLA file please ?!...
Mathieu
|
|
|
11-13-2002, 03:02 PM
|
#6
|
|
Nxovkn
Join Date: May 2002
Location: Chattanooga, TN
Posts: 37
|
Ahh okay found out why my code was wrong. You must set a root node before adding nodes. So do this instead.
myTree.setRootNode(new FTreeNode("Fruits"));
myTree.addNode(myTree.getRootNode(), obj1);
myTree.addNode(myTree.getRootNode(), obj2);
|
|
|
11-13-2002, 03:05 PM
|
#7
|
|
Nxovkn
Join Date: May 2002
Location: Chattanooga, TN
Posts: 37
|
Here's the file I made for you...
|
|
|
11-14-2002, 11:40 AM
|
#8
|
|
Senior Member
Join Date: Oct 2001
Location: Fiji
Posts: 187
|
Wow !
Thank you !
Mathieu
|
|
|
11-26-2004, 04:18 PM
|
#9
|
|
Registered User
Join Date: Nov 2004
Posts: 2
|
hello ..
I'm trying to do two different Tree Extensions.
the major one is a tree which each node contains a list of checkbox Objects.
The other one, which i think it's easier, it's to select/unselect on click of any element of the node with multiselection feature.
Would like to know if this is possible to do specially the major one.
Thanks a lot ....
|
|
|
06-24-2009, 06:41 AM
|
#10
|
|
Registered User
Join Date: Jun 2009
Posts: 1
|
not able to download zip file
Hello,
I want to look at the source code but not able to download the zip file. Could you please upload it once again?
Thanks in advance,
Ankita
|
|
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 04:47 AM.
///
|
|