Tree In AS3
I noticed there was no tree component in AS3. I plan on making a tree style menu with sub menus and stuff so should I just do this project in AS2 or is their something I can make similar to a tree component in AS3?
KirupaForum > Flash > ActionScript 3.0
Posted on: 09-19-2007, 02:13 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Accordion/Tree Navigation ... Tree DataProvider Issues
Hello all!
I've done a navigation scheme that uses both the accordion and tree components. The data being gathered is from an XML file. The only problem i'm having is getting the tree components to display the data that they're being provided with. I did traces and I found out that they are getting the data...can anyone take a look at the FLA and see what's going wrong?
http://www.jake3p0.com/downloads/accordionTreeNav.zip
I'm using Flash 8
How Do I Make A Tree Menu? Like The Explorer Tree?
I am currently writing a tree menu in flash that will look nearly identically to the std tree widget in windows (like explorer).
my problem is.. how do i link an object to an mc?
ie i have made a node class with member variables and methods (an array of child nodes and the LoadChildren method) and i have an mc that i want to be duplicated for each node (a little folder icon thingy).
when a node loads its children via xml it will get the data then create an array of child node objects:
for each child in xml
{
var node = new node("name from xml", "data from xml");
children.push(node);
}
so at the end of this i have a nice array of child nodes.
I dont know if i put the code that defines the node class into the folder thingy mc and then duplicate that or what..
Has anyone seen an example of something like this anywhere.. i saw a cool tree ages ago but i cant find it now..
I know its a bad explanation but my brain hurts at the moment
thanks for any help =]
Need To Find Tree Graph Or AVL Tree
Does anyone know where I can find a tree graph, also called an avl graph, which I can modify? I am creating a flash console to manage computer nodes on our system and need a dynamic tree graph to represent where the nodes are located and be able to represent child/parent relationships. It would greatly help if I found an example or something to build off of.
Thanks!
Expend All Folders In Tree (tree Component (Flash MX 2004/Flash 8))
Hello all,
I have a tree component witch reads an XML file. Now On my tree I got folders and subfolder. I want by a press of a button, to be able to expend all the folders of my tree. How do you do this?
Tree format: (view attachment)
Tree XML file:
PHP Code:
<node label="Project 1">
<node data="data1" label="Item1" />
<node data="data2" label="Item2" />
<node data="folder1" label="Folder">
<node data="data3" label="Item 1 in folder" />
<node data="data4" label="Item 2 in folder" />
<node data="folder2" label="Folder in folder">
<node data="data5" label="Hello!" />
</node>
</node>
</node>
Any ideas, paths? Please!
Thank you A LOT in advance!
Hor. Xml Tree
some of you may know an xml tree
i need a hor. solutions to show the hierachie of a company.
i dont know how to do this. Is there anywhere a .fla or tutorial ?
thanx for your help
V2 Tree Help
Salutations...
I need great help with using the new V2 tree (flash MX 2004 Pro). I have code that uses the V1 tree and it works perfectly! The problem that I have is that I need the tree to scoll both verticaly and horizontaly! I'm not able to activate an horizontal scrollbar!
So my first question is :: Is there a way to scoll horizontaly in a V1 tree and if not .... I must use the V2 tree.... it seems to come equipt with one.
Question 2 : I cannot use my V1 code to load XML file into a V2 tree! There is always only undefine nodes! Is there samples that I can look at?
Thanks a million times for the help!
Tree
As I can select in "tree" the first subnode? I have the following code.
Code:
miArbol.getTreeNodeAt(0).addTreeNodeAt(0,miArbol.selectedNode.attributes.label) *Add Node **
miArbol.selectedNode=miArbol.getTreeNodeAt(0) *Work... Ok
miArbol.setIsOpen(miArbol.selectedNode, true, true);
miArbol.selectedNode=getTreeNodeAt(1) *No work*
You pardon, but use a translator. Greetings
Gracias...
Saludos
Tree Xml
I want to basically copy an xml object I have created, take the children from a specified node and make a new xml object from them and put this new xml into the tree component.
Can you see what is wrong with this?
ActionScript Code:
myXML = new XML();myXML.ignoreWhite = true;myXML.load("tree_source.xml");myXML.onLoad = function(){ var newXML = myXML.firstChild.firstChild.childNodes; myTree.dataProvider = newXML;}
Xml Tree
Hi,
does anyone know of any alternatives to the tree componant?
cheers.
G
Xml Tree
Hi,
i am try to learn from this:
http://www.kirupa.com/web/xml/exampl...4ASclasses.htm
does anyone know if its possible to start with all the folders closed?
cheers.
G
Its Me In The Tree .. ^^
hello, i got a little problem with my menu.
i have a scripted cascading menu in flashMX(quite nice actually) ...
but i want that if any linkbutton is pressed to fase out (so the site is less laggy, lotta animation).
here is the problem :
the mainlinks are MCs with buttons inside..
How can i tell a button inside an MC to "goto" somewhere in the mainScene ?
something with lvls or so ?
thx for any help . . .=)
Tree In AS3
I noticed there was no tree component in AS3. I plan on making a tree style menu with sub menus and stuff so should I just do this project in AS2 or is their something I can make similar to a tree component in AS3?
Tree Help...
I'm trying to do this:
var atts = theTree.selectedItem.attributes.*
So that the value of the variable 'atts' is equal to all the attributes of that tree item which is actually an xml node.
I need to do it this way because all the nodes have different attributes.
But it doesn't work.
Anyone know how to accomplish this the right way?
XML And Tree
I used the tutorial to create the tree component. Everything works great. I modified it so that the actionscript (instead of getting a URL) gets a FlashPaper document to open in the actual movie. What I'm looking to do is add to the functionality of the tree component.
Is there a way I can load more attributes from my XML file, other than the URL and tree description? I'd like how I've modified the tree component to load an external FlashPaper file, but i would like for it to not only load the file to view, but for that click to switch the URL on a button that is clickable to download the original .doc file. Is this possible?
So, essentially, i'd be loading two different URLs from my XML into the Flash document. One URL opens an external swf with FlashPaper (which I've already done) and the other one would attach to a button, which the user can click to download the original .doc file. I'm not the best with actionscript, but i'm starting to learn the ropes here. Thanks for any help!
Tree Menu?
how do I creat the left menu like on http://www.spoono.com ?
I found this tutorial on www.virtual-fx.net but it is not quite the same.
how do I adjust the tutorial so it will be the same as spoono's one?
I mean the sliding effect and when lets say you push the tutorial button and then you push the desktop button, first the tutorial button comes up and only then the desktop button comes down.
hope you got it
Folding Tree (Please Help)
Hi everyone,
what is the best way to create an expandable folding menu tree in flash?
Like the kind where a plus sign is to expan and a - sign retracts the menu.
I created the images, and I have some actionscripting knowledge.
Would I have to create a movie clip?
- Leland
Tree Menu
hi there,
can someone please tell me how i can change the labels (eg. object 1) of the buttons in the following .fla ...
http://www.flashkit.com/movies/Inter...71/index.shtml
thank you so much in advance
Dynamic Tree
i have used flash for a while but have never really gotten into actionscripting... so i know very little.
im trying to make a dynamic tree that i saw somewhere once where it creates itself dynamically, it "grows". if someone has an idea or some script that will help me or a tutorial or something i would really appreciate it... im kinda at a hump in learning actionscripting and even if you have a link to a site or tutorial that can help me that would b cool, tnx.
-notafish
Tree Buttons
Hi there
Is there some one who can teach me (again) the tree button.
The (again) is because I've have a stroke and my brain is out there some where. Thanks
How Do I Know The Nodename Of A Tree
How do I determine the nodename of a node of a tree?
Example:
RootNode ----- Nodename = "Rootnode"
node1 ----- Nodename = "node1"
Thanks,
Raymond
Outline Tree
How do I change the look of the Outline Tree?
Right now all I see is something called,"Shape" I need to see where the text is so I can change it. Help....
Tree Menu Help
I want to build a tree menu in flashMX.
This is how far I have come:
//init state for minus button
mappe.minusbutton._visible = false;
mappeinitY = 35;
//
for (i=0;i<5;i++) {
mappe.duplicateMovieClip("mappe"+i,i);
with (_root["mappe"+i]) {
_y = mappeinitY + (mappe._height + 5) * i;
_x -= (mappe._width - 12.5);
minusbutton._visible = false;
}
}
Now, the problem is that I somehow have to tell the right folders to drop down when the folder above is being pressed.
Thanks for any help!
Horizontal Tree
hi everyone.
i am developing a site for mlm company.
one of the tasks is to build a visual downline tree for
the resellers.
thas any one know a script or alink to info regurding building
horizontal tree (not vertical like the regular tree component)
thanks to all,
piny
Menu Tree
I'm looking for a tutorial on a menu tree if anyone knows of one please let me know.
Thanks
Betsy
Menu Tree
Hey guys i have been playing around with flash since flash 4 but am self taught by trial and error. I have errored so many times now that my head hurts from beating it on the monitor. I need someone to actually show me a tutorial for how to make a true menu tree. NOT SELL ME something. I have gotten very close but it doesn’t disappear when I mouse out on the button. Please any help you can give is much appreciated. An example of what I’m looking for is the menu bar at http://www.santaanita.comor like http://www.macromedia.com/ thanks
MM Tree Menu
Hello
I am trying to figure out how to either use the
Macromedia tree extension
http://www.macromedia.com/software/flash/
or build something similar.
Can anyone help me?
Thanks in advance
Quote:
*sparking the world*
Tree Question
I'm populating a tree component with an xml page. I have a data attribute that is a link. How would I write the code that says... when branch selected go to link? Thanks in advance...
Tree Structure...
I am developing an interface, which will allow navigation between quite a lot of samples. Having done a few experiments previously I am of the opinion that generating the buttons in script from some sort of array would be best.
If my structure would be something like this
Code:
A---1---xA.1.1
---xA.1.2
---xA.1.3
---2---xA.2.1
---xA.2.2
B---1---xB.1.1
---2---xB.2.1
---xB.2.2
etc. etc.
would the best way of representing it be
Code:
main = newArray()
main[0]= null
main[1]= [ ["xA.1.1", "xA.1.2", "xA.1.3"], ["xA.2.1", "xA.2.2"] ]
main[2]= [ ["xB.1.1", ["xB.2.1", "xB.2.2"] ]
and so on,
I also realise that if I use objects I could hold other information, but I guess really what I'm asking is, is there a different or better way of doing this?
Christmas Tree
Hi all,
I am trying to make interactive x-mas card. I draw christmas tree and glass balls. My idea is to dress christmas tree useing that for glass balls My problem is that just one glass ball works properly, I mean I can move my glass ball and leave it on my christmas tree. But anytime I press mouse button to take another glass ball my glass ball no1 is moving into other place. I would like to lock it but I dont know how. Beside it I want to use many glass balls and leave all on my tree so that they won't move. What may I do about it? Please help me. Greets Zuz
Scrollpane And Xml Tree, Is It Possible?
is it possible to dynamicly resize scrollpane according to xml tree inside it. When I expand or collapse child tree I want scollpane to resize scrolled area and scrolbar
mx2004
bart
Tree Chart
I want to create a chart which I want to present in Hierarchy Order. The data for the chart will come from database and it will be shown graphically in flash. I have attached a .gif image to show an example of what sort of chart I want.
Please let me know if there is any sort of tutoriol for this.
Salim
Tree Component - Please Help
Please help anyone. I have a tree that is populated by "loading" and xml file that is produced by a CFDirectory call. When I click on one of the folders in the displayed tree, I then call the CF file again with the full path for that file resulting in the XML for that folder being sent back to me.
All of this works up to that point, however, I cannot get the new XML to be inserted into the proper place in my tree. For instance, lets say the root folder is called "Mail". When I click on it, I want the subfolders, "InBox, Sent, and Trash" added as child nodes of the Mail folder.
Also, I cannot figure out how to delete a child node, not a root node, from a branch. Using the example above, lets say I just want to delete the "Sent" node completly. How do I do this?
Thanks in advance for any and all help.
CFDaddy
Tree Component
Does anyone know if it is possible to have the text in a row of a tree menu wrap around and display below instead of going off to the side?
Tree GetIsOpen, HELP
Hey Im using the flash pro tree component. I am trying to determine if a node is open or closed in the trees on(openNode) event. Here is the code I am using to check the node state:
myTreeDP = new XML();
myTreeDP.ignoreWhite = true;
myTreeDP.load("apptree.xml");
myTreeDP.onLoad = function()
{myTree.dataProvider = myTreeDP;
myTree.setIsOpen(myTree.getTreeNodeAt(0),true);
}
myTreeDP.change()
{
trace(myTree.getIsOpen(myTree.getTreeNodeAt(0)));
}
as you can see I set the branch to open, and it opens, but when i check the value using the isOpen it always returns false! Even though it should be true!
Can anyone help?
Thanks
Dan
Fle Tree Component
Hi everyone,
I'm building an application that uploads picture files on the server... I was woundering if there are tree components that can read the contents of the local machine (rather than XML files) in order to browse to the file select for the ftp upload... I can do it with java or ASP but I think it would be nice to do it with flash... Any thoughts, hints and links will be greatly appreciated...
Thanks,
peter
Tree Help Using Icon
Hi all,
I'm trying to use the tree component but I'm not haveing any luck setting the icon using:
myTree.setIcon()
Is there someone who could help me out or give a very very simple and direct to tthe point working example that I can build upon?
Thanks,
Butch
Help With Tree Menu
Hi,
I'm in the middle of creating a tree menu that needs to expand/collapse when items are selected. I'm drawing all my info from a DB via sendAndLoad.
I'm having alot of problems getting the "math" right for the menu tho. If you look at the attached movies (play main.swf, which loads 1.swf) and click on Villas, you'll see what I mean. I need to have each of these items expand/collapse when they are clicked on. There will never be more then one layer under each main country, so it only has to do the expand/collapse when clicking a country.
As you'll see it's certainly not working properly as is. I wouldn't normally ask for something this large, but I was wondering if someone could take a look at my source and point me in the right direction as to how what logic I should be using. I just can't get my head around the math and logic involved to do this task.
Any help is much appreicated.
XML And Tree Component
hi.
first of all: i'm not a native english speaker ...so please forgive my spelling errors
i am using a tree component that loads an xml file. it loads fine, all ok.
the problem is when the xml file has more nodes with the same name.
i'll give a practical example:
3 nodes each one with a son. let's say node1, node2, node3 and son1, son2 and son3.
the problemm: node1 and node3 have the same name, son1 and son3 have different values.
at this point the tree component creates 3 nodes
is there any way of preventing that? any flash predefined function? or i have to write my own as to check for that?
i'm using flash mx 2004 professional and a working example of this can be seen on my homepage
thanks for help,
sia
Family Tree
Can anyone help me to develope a family tree viewer for my web site?
I would like to create it in the form of a tree and not just a list with links to each page.To start the scene imagine a tree growing from a seed and has it grows each branch will have a family on it !! a bit hard to explain but if you can help I would be best pleased.
Mark
mark.phillis@ntlworld.com
Tree Menu
I have checked out several tree menus on the web but can´t find what I´m looking for.
All the tree menus I have seen use xml and let you link to a url when pressing a menu item whereas I want to load a swf into an mc.
any suggestions would be great
thx
Tree Component (yes Again)
Im sure this has been asked before...but I tried to search for tree component and it didnt result in any noobie threads.
I have NEVER used the tree component before... and am looking for al ittle hand holding on setting up my first one...
but ore specifically I would like to get some links to good tuts or MM links to how to use it in its most BASIC formm even...
Thanks..
Tree Component
I have been following this tutorial on creating a tree component in Flash, however for the life of me I cannot figure out how to do a onclick command.
What I am wanting to do is when you click on one of the menu items it will load a particular frame without loosing the menu.
Does anyone have any suggestions on how I might be able to get this to work.
Here is the link to the one I have been trying out. LINK
XML Tree Needs Wordwrap
I am trying to get my tree component to word wrap. I know you have to add something with the Cell Render API, but I dont know what and where.
Tree Component & The XML Is Can Use..
ok..I have a tree component on my stage (theTree)
the code:
Code:
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(){
theTree.dataProvider = this.firstChild;
}
//myXML.load("date.xml");
//myXML.load("prod2.xml");
myXML.load("products.xml");
var treeObj:Object = new Object();
treeObj.change = function() {
//
var itemSelected = theTree.selectedItem;
trace("Item selected: "+itemSelected);
}
theTree.addEventListener("change", treeObj);
you can NOT use the VALUES of any XML nodes for anything?..can this be correct? (I surely hope not)... also..the only way to populate the tree is by using attribute tags in the XML doc?
here is some sample XML files.. and the results:
products.xml
PHP Code:
<products>
<product>
<image>image1.jpg</image>
<name>PiraTe 1</name>
<price>1.99</price>
<size>
<choice>X-SMALL 1</choice>
<choice>SMALL 1</choice>
<choice>MEDIUM 1</choice>
<choice>LARGE 1</choice>
</size>
<color>
<choice>GREEN 1</choice>
<choice>BLACK 1</choice>
<choice>GREY 1</choice>
<choice>RED 1</choice>
</color>
<description>etc..etc..etc.</description>
<link>javascript:NewWindow=window.open('image1.jpg','Product_Details','width=85,height=100,left=100,top=100,screenX=100,screenY=100');NewWindow.focus();void(0);</link>
<quantity>
<choice>1</choice>
<choice>2</choice>
<choice>3</choice>
<choice>4</choice>
<choice>5</choice>
</quantity>
</product>
<product>
<image>image2.jpg</image>
<name>X-Bones 2</name>
<price>9.99</price>
<size>
<choice>X-SMALL 1</choice>
<choice>SMALL 1</choice>
<choice>MEDIUM 1</choice>
<choice>LARGE 1</choice>
</size>
<color>
<choice>GREEN 1</choice>
<choice>BLACK 1</choice>
<choice>GREY 1</choice>
<choice>RED 1</choice>
</color>
<description>etc..etc..etc.</description>
<link>javascript:NewWindow=window.open('image2.jpg','Product_Details','width=85,height=100,left=100,top=100,screenX=100,screenY=100');NewWindow.focus();void(0);</link>
<quantity>
<choice>1</choice>
<choice>2</choice>
<choice>3</choice>
<choice>4</choice>
<choice>5</choice>
</quantity>
</product>
</products>
I only get [functiomType],[functiomType],[functiomType]..etc as a result in the tree.
date.xml
PHP Code:
<tree>
<date label="date">
<month label="month" traceId="ok">Jan.</month>
<day label="day" traceId="ok">27</day>
<year label="year" traceId="ok">2006</year>
</date>
</tree>
the folders get names assigned to them..however the sub folders..when you open the..same thing..[functionType]...etc.. if you have ANY value between a node element...what can you do with it?
Doesnt seem to work well with XML like this...
anybody??
The Tree: Other Images
Hi there.
I am creating a tree navigation for my website. All of the technical aspects of it work fine, but I am looking to go away from the style it defaults to.
For an example of what I am doing, here is an image:
The problem that I have is the 'Main Menu' text is a unique font, and I would be surprised if anyone would have it.
The second is the little bar under main menu. How would I place the image there?
I could solve both of these problems if I could simply replace it with two images, one for the open and closed state, but how could I do that?
Lastly, the red circles to the side I want to be rollovers. In the deactive state, the circles are filled with the maroon background color, and when the mouse hovers on them, they fill in with the lighter red. Once again, this could be solved with a simple rollover, but how do I add that to a tree component?
Thanks
Navigation Tree
Im creating a Tree Vertical navigation using the tree component, the issue i have is setting the style the "child" <nodes>, I would like the "Parents" to be bold and the "child" to be regular, but i have no idea how to do this. Also I would like the ability to make the "child's" icon individual.
any help much appreciated.
thx
Tree Component On Mac And Pc
hello,
im building an application that needs to be cross platform, mac pc
i have a tree component i'm using throughout, and it functions %100 on a mac, but i burned it on a cd and tried it on a pc and it doesn't display anything
i was under the impression that tree components were universal across platforms, is there a piece of code needed for it to work on a pc?
i know its not a font issue becasue the font shows up in textarea components elsewere
any help would be greatly appreciated- doni
Tree Vs Explorer
Hi
Here i have a problem with tree component. Using tree component i can load xml tree nodes, but i need to load my system's hard disk drive information(like explorer) to tree component. How can i do this. if anybody know about this, plz help out...
phani.
|