Why No Tree Component For AS3?
Why is there no Tree component when working with an AS3 based Flash 9 file?Kevin
Adobe > ActionScript 1 and 2
Posted on: 05/31/2007 09:22:32 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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!
[F8] Tree Component Within Accordian Component
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...but it simply isn't being displayed. Can anyone take a look at the FLA and see what's going wrong?
http://www.jake3p0.com/downloads/accordionTreeNav.zip
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?
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
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
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
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??
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 Component
I have a tree component that I want to have the following functionality...
I want only one branch open at a time...so when the user expands the first branch it reveals all of its items inside that branch...then when the user chooses a second branch (without first closing the first branch) the first branch will collapse and only the new selected branch will have all of its items visible...I tried to store the nodes in an array, and then just close the node with array[index-1] but I cannot seem to be able to store the nodes, or even the index of the nodes in an array...are there any efficient way of doing this?
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 ?
Tree Component In CS 3(AS 3.0)
Hi evry1
Can any1 pls suggest how to use a tree component in CS3 thru AS 3 only not thru AS 2...??? And i don't want to use Yahoo Astra also...
Thanks in advance!!!
Tree Component
I've made a photo galery like in flash semples "...MacromediaFlash 8Samples and TutorialsSamplesActionScriptGalleriesgallery_tree.fla". The lables of fotos are loaded to the "Tree component" from the XML file. The question is if the label of photo is too long, how to make it in multiline automatically in a tree component!
Tree Component
I've made a photo galery like in flash semples "...MacromediaFlash 8Samples and TutorialsSamplesActionScriptGalleriesgallery_tree.fla". The lables of fotos are loaded to the "Tree component" from the XML file. The question is if the label of photo is too long, how to make it in multiline automatically in a tree component!
Edited: 02/11/2007 at 10:00:48 PM by makmarkit
Tree Component
I want to make a help application for a flash application. I think the best way to do this is to use the tree component. I've been playing around with it and I've got it display the various sections of help. I want the actual help text to be read from the XML of the menu.
Problem is, because the node has a child (the help text), the menu displays the arrow and folder icons indicating it's a branch. I've got it to only open the branch and display the text if the child nodeType is not a text node, but clicking the arrow rather than the text still opens the branch. Also I don't want the icons to be set to the branch icon if its child is a text node.
I have yet to play with setting the icon, but this all seems a haphazard way of doing things when all I want to do is just set a node's property as a leaf rather than a branch regardless if it has children or not.
One last thing, is there a better way to approach this whole application?
TREE Component
Hi guys!
Is there a tutorial somewhere that I can learn how to populate a tree
component?
Thanks!
Tree Component
Are there any one out there who can help me with a problem.. I want to have the tree component om my webpage but I want it to be transparant so that you can see the background thru it. But I´ve looked every where and asked a lot of people but no one seems to know how to do it!
If you can help me maybe I can help you with something back..
Tree Component
Hi ye,
The code on my Flash tree component has:
var treeL:Object = new Object();
treeL.change = function() {
var item = theTree.selectedItem;
var earl = item.attributes.url;
if(earl) {
getURL(earl ,target=myIframe);
}
}
the xml file it reads from has eg.
<tree>
<folder label="Test">
<link label="TSample" url="one.html" />
</tree>
The myIframe target above is on the same html page as the tree component, but instead of loading the file "one.html" into
the target myIframe, it gets loaded as a separate one.html page.
The question is, how do I target an Iframe named myIframe with its layout controlled by a content id, from a Flash tree component on same html page, and get my one.html file to load into it??
The one.html file currently loads as a separate hml page.
thanks
Colm
Tree Component
How can i find the parent of an node.
What I'm trying to do is, on drag and drop not to be able to drop a node in to one of his childes.
Hope you understand
please help
tks
Edited: 02/14/2007 at 01:03:20 AM by gigisfarleaza
Tree Component
Hello,
i have Tree component with instance name fruit_tree. I addItem like this:
for (i=0; i<fruitsArr.length; i++) {
fruit_tree.addItem({label:"scene "+(i+1), data:i});
}
and want to clip button and removeAll(), but it does not work intil this all items are in node. removeAll - delete only node.
Someone know some other way to do remove it?
Attach Code
for (i=0; i<fruitsArr.length; i++) {
fruit_tree.addItem({label:"scene "+(i+1), data:i});
}
Tree Component
want that the text written at its nodes at different level are in different
font.Is it possible ?
Eg:
node1 arial font
---child1 of node1 in verdana font
---child2 of node1 in verdana font
node 2 arial font
---child1 of node2 in verdana font
---child1 of node2 in verdana font
If not possible can u tell a link or tutorial for making such a componenet
Plz help
Tree Component
How can i change the color of text on rollover/rollout, only for that item ?
tks
Why No Tree Component?
hmmm, I see a tree control/component in AS 2 but not AS 3. must have missed something. maybe there's an xml view of some kind? what I need wouldnt just show raw xml but would be a stylized, skinnable, user friendly UI component..
am I supposed to roll my own? if so, any tips on how to go about that? nesting the existing list component maybe?
thanks!
Edited: 03/23/2008 at 10:50:08 PM by ceteris
AS3 Tree Component
Hi.
I am just wondering if there is a Tree menu component for AS3 I cant find one, if not can anyone suggest an alternative?
Thanks
Barry.
Tree Component Help
hi everybody,
today i was going through the new updated help of mx2004 and in the tree class help i just couldnt digest one thing it was given as
Tree.setIcon() ------ Specifies whether a node is open or
closed.
Tree.setIsOpen() ------ Specifies a symbol to be used as an icon
for a node.
=============================================
can anybody help me with the tree component
I need to open the tree node but clicking on the name but the node opens on clicking the arrow icon beside it
Xml Tree Component
Does anybody know how to use the xml tree compenent menu?? It reads from an xml file but I do not know how to get to read or anything. If anyone knows of a good tutorial for it I would appreciate it. Let me know if you need more specifics on what I am tring to do. (it is in the Flash UI COmponents Set 2)
Use Of Tree UI Component...
Hi all,
Could anyone help me find a good start for learning the use of Tree UI component, where I can load XML on it. Like a list of populat web search engine, so when I click on it they will bring the user to the site.
Thanks.
Please help.
XML TREE COMPONENT
Does anyone know how to make the title of the tree conponent's folders to return on to 2 lines if the title is larger then the set width of the component.
Tree Component
is there a way to populate the tree with folders present on my hard disc .
eg : E:soumya .
if the user clicks on it , the files & folders inside e:soumya shud be shown automatically ........ something like the file list box in VB ????
Tree Component
http://livedocs.macromedia.com/flash...=00002881.html
Was testing this out to use as a navigational menu. I can't find anything in the documentation on how to create the links. Can anybody help?
“Tree Component”
Hi:
I’m a Kind of new in flash MX ,, so can any one help me pleas.
Where can I modify or put items in the “Tree Component” (Flash Professional 8 )
Thanks
Tree Component
I am trying to use the tree component(already populated via xml file) to load images into an empty movieclip on the stage.would anyone be kind enough to provide sample script(both xml and as) or show me a tutorial that shows how this is done.
thanks.
Tree Component And Map
Need a little help here guys. The concept seems simple but I'm having troubles. I'm building an interactive map using an XML driven Tree component as the source of the navigation. The navigation contains items like hotels, airports, gas stations, etc. I want the user to be able to select an item from the Tree and have the map zoom to that location. The map is just a vector based image within a movieclip. I'm having trouble understanding how I can get the XML Tree items to communicate with my map. I'm thinking it needs to send over x and y coordinates...kind of confused on this one. Any help would be appreciated.
Thanks!
Tree Component Help Please.
Okay so I have a tree menu component. I want to put a node into a branch without using xml please help me.
: king::huh :
Tree Component
I have a tree component that I want to have the following functionality...
I want only one branch open at a time...so when the user expands the first branch it reveals all of its items inside that branch...then when the user chooses a second branch (without first closing the first branch) the first branch will collapse and only the new selected branch will have all of its items visible...I tried to store the nodes in an array, and then just close the node with array[index-1] but I cannot seem to be able to store the nodes, or even the index of the nodes in an array...are there any efficient way of doing this?
Tree Component Help
hi everybody,
today i was going through the new updated help of mx2004 and in the tree class help i just couldnt digest one thing it was given as
Tree.setIcon() ------ Specifies whether a node is open or
closed.
Tree.setIsOpen() ------ Specifies a symbol to be used as an icon
for a node.
=============================================
can anybody help me with the tree component
I need to open the tree node but clicking on the name but the node opens on clicking the arrow icon beside it
Use Of Tree UI Component...
Hi all,
Could anyone help me find a good start for learning the use of Tree UI component, where I can load XML on it. Like a list of populat web search engine, so when I click on it they will bring the user to the site.
Thanks.
Please help.
Xml Tree Component
Hi I am trying to make a tree menu for a website that I can change via .xml file whenever any links change, can anyone help me?
Tree Component
I have question about the tree component that comes with Flash MX 2004 Pro.
What I’d like to do is to show the tree of say my music so starting with root as Music I'd have:
Music -> Dream Theater -> Falling Into Infinity -> 1 songs’ title.mp3
2 song’s title.mp3
.
.
etc.
I’d like to be able to determine if what I’m clicking on is a folder or a file and if it’s the file in mp3 format, the mp3 player (the one that also comes with Flash MX 2004 Pro called Media Player) would load that song an play it.
My tree component works so far with no problems. I see the tree there etc.
I simply don’t know how to determine what it is I’m clicking on at the moment. Also each time I click on mp3 file OS recognizes that it is an mp3 file format and automatically loads quicktime player, at least I think that it is an Operating system that does that.
I looked through the help files for tree component and tree object itself but the only events it supports are NodeOpen and NodeClose.
I though I could do something like that.
onMouseClick{
if it’s a folder I clicked on ignore it
if it’s a file and it is an mp3 file (I’ll do some validation) take the URL included in my XML file that is “attached to the tree component” and load that URL into the player….
}
Something like that would work I think, if I was able to use some mouse clicking event so I could use this even to determine the file/folder thing.
Any suggestion of how can this possibly be done?
Thanks
UI Component 16. TREE HELP
Is there a way to
1. have the tree open all the way or have main Nodes open to click on
2. After a user clicks on the Node of choice to send the user to a website or fire a differant type of event?
Thanks,
Still so new at this.
Steve
Tree Component
Can we not enter text manually into the tree component? From looking at the tutorial I got the impression that you can only load via XML ...
Any info would be appreciated
Sandman9
Help With A Tree Component
Hi all,
Its been along time since i have posted here
Basically i am trying to finish a page on a website and i need a tree component to display the services for the webpage, when i click on the service that i need i want the text to be loaded into a text box.
The Problem:
I have managed to poulate my list with the fields i require but i cannot seem to get the text to load into the text box i have on the stage. I can not remember how to do this as i am a bit rusty.
Here is my Test XML:
Code:
<tree>
<folder label="Assest Management">
<link label="1" info="Assest Management 1" />
<link label="2" info="Assest Management 2" />
<link label="3" info="Assest Management 3" />
</folder>
<folder label="IT Management">
<link label="1" info="1" />
<link label="2" info="2" />
</folder>
<folder label="Network Solutions">
<link label="1" info="2" />
<link label="2" info="2" />
</folder>
<folder label="Technical Support">
<link label="1" info="1" />
<link label="2" info="2" />
</folder>
</tree>
Here is my Test Action Script taken from a tutorial:
Code:
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function(){
Services_tree.dataProvider = this.firstChild;
}
xml.load("members.xml");
var treeL:Object = new Object();
treeL.change = function(){
var item = theTree.selectedItem;
var earl = item.attributes.url;
if(earl){
getURL(earl,"_self");
}
}
Services_tree.addEventListener("chang",treeL);
Basically i really need some help or guidance or what ever someone can offer, so that when i select the link label of the XMl it will load the info into a text box called services_txt.
I know i have to add something, but what is that somthing
Many thanks
Dunkyb123
More Tree Component
I'm trying to work with Lee's tree component toot. Here's were I am so far..
Code:
var xml:XML = new XML();
xml.ignoreWhite = true;
//
xml.onLoad = function() {
theTree.dataProvider = this.firstChild;
};
//
xml.load("tree.xml");
//
var treeL:Object = new Object();
treeL.change = function() {
var item = theTree.selectedItem;
var earl = item.attributes.url;
if (earl) {
getURL(earl, "_self");
}
};
theTree.addEventListener("change",treeL);
//
drawRowFill(theTree,0x00FF00,0);
//
//Thanks to "vamapaull" @ gotoandlearn for this sectoin of code url= http://www.ludvigjernqvist.se/forum viewtopic.php?f=15&t=9803
//This code set the list and tree components bg's to transparent
//
mx.controls.treeclasses.TreeRow.prototype.drawRowFill = mx.controls.listclasses.SelectableRow.prototype.drawRowFill = function (mcTarget:MovieClip, nNewClr:Number) {;
switch (mcTarget._name) {
case "bG_mc" :;
//Alpha when the row is not selected
var tempAlpha = 0;
break;
case "tran_mc" :;
//Alpha when the row is selected
var tempAlpha = 0;
break;
default :;
var tempAlpha = 15;
};
mcTarget.clear();
//Here's the trick
mcTarget.beginFill(nNewClr,tempAlpha);
mcTarget.drawRect(1,0,this.__width,this.__height);
mcTarget.endFill();
mcTarget._width = this.__width;
mcTarget._height = this.__height;
//Hide the main bg of component
this._parent._parent.depthChild0._alpha = 0;
};
//;
// Remove the Scroll ednges and use text rollover highlighting
// + Add new icons.
theTree.vScrollPolicy = "off";
theTree.hScrollPolicy = "off";
theTree.setStyle("textRollOverColor",0xFFFFFF);
theTree.setStyle("textSelectedColor",0x00CCFF);
theTree.setStyle("defaultLeafIcon","mcIconHolder");
theTree.setStyle("folderOpenIcon","mcIconHolder");
theTree.setStyle("folderClosedIcon","mcIconHolder");
theTree.setStyle("disclosureClosedIcon","mcIconHolder");
theTree.setStyle("disclosureOpenIcon","mcIconHolder");
The problem I can't solve at the mo is getting the getUrl method to work outside the flash environment +
Making the text selectable rather than just the icons. Searched all over the forums and this problem seams to be inadequacy addressed so any help as always greatly received.
Related links...
http://theflameproofworld.com/_forum/_t ... ample.html
http://theflameproofworld.com/_forum/_t ... xample.fla
thanksInAdvince();
XML With Tree Component
Hi,
I?m having some trouble with the tree component. Using Lee?s XML Video playlist tutorial I have a list populated by an xml file and videos playing on the stage, I?ve changed very little to the original tutorial file so far and it works fine. All I?d like to do is use the tree component rather than the list so that I can split videos up into folders. I?ve followed the ?tree component? tutorial and have replaced the list with a tree, renamed it, and it works, except the folders in my xml come back with ?undefined? errors.
I presume that I need to set variables up so the tree knows which part of the xml text refers to a folder, but I?m at a bit of a loss as to how to it. Any ideas anyone?
Here?s my xml file:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<tree>
<folder label="Gallery 1">
<video url="video1.flv" desc="Video 1" />
<video url="video2.flv" desc="Video 2" />
</folder>
<video url="video3.flv" desc="video 3" />
<video url="video4.flv" desc="video 4" />
<video url="video5.flv" desc="video 5" />
</tree>
And here?s the actionscript:
Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
ns.setBufferTime(10);
ns.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}
if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
}
if(info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
}
playButton.onRelease = function() {
ns.pause();
}
rewindButton.onRelease = function() {
ns.seek(0);
}
this.createEmptyMovieClip("vFrame",this.getNextHighestDepth());
vFrame.onEnterFrame = videoStatus;
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function(obj) {
duration = obj.duration;
}
function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * 208.9;
loader.scrub._x = ns.time / duration * 208.9;
}
var scrubInterval;
loader.scrub.onPress = function() {
vFrame.onEnterFrame = scrubit;
this.startDrag(false,0,this._y,208,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
vFrame.onEnterFrame = videoStatus;
this.stopDrag();
}
function scrubit() {
ns.seek(Math.floor((loader.scrub._x/208)*duration));
}
function pauseIt() {
ns.pause();
}
function stopIt() {
ns.seek(0);
ns.pause();
}
function restartIt() {
ns.seek(0);
}
_root.createEmptyMovieClip("vSound",_root.getNextHighestDepth());
vSound.attachAudio(ns);
var so:Sound = new Sound(vSound);
so.setVolume(100);
mute.onRollOver = function() {
if(so.getVolume()== 100) {
this.gotoAndStop("onOver");
}
else {
this.gotoAndStop("muteOver");
}
}
mute.onRollOut = function() {
if(so.getVolume()== 100) {
this.gotoAndStop("on");
}
else {
this.gotoAndStop("mute");
}
}
mute.onRelease = function() {
if(so.getVolume()== 100) {
so.setVolume(0);
this.gotoAndStop("muteOver");
}
else {
so.setVolume(100);
this.gotoAndStop("onOver");
}
}
var vlist:XML = new XML();
vlist.ignoreWhite = true;
}
vlist.onLoad = function() {
var videos:Array = this.firstChild.childNodes;
for(i=0;i<videos.length;i++) {
videoList.addItem(videos[i].attributes.desc,videos[i].attributes.url);
}
ns.play(videoList.getItemAt(0).data);
videoList.selectedIndex = 0;
}
var vidList:Object = new Object();
vidList.change = function() {
ns.play(videoList.getItemAt(videoList.selectedIndex).data);
}
videoList.addEventListener("change",vidList);
vlist.load("Playlist.xml");
var treeL:Object = new Object();
treeL.change = function() {
var item = videoList.selectedItem;
}
theTree.addEventListener("change",treeL);
videoList.setStyle("selectionColor",0xCCCCCC);
videoList.setStyle("textSelectedColor",0x000000);
videoList.setStyle("rollOverColor",0xEEEEEE);
Thanks very much,
Mike
[/code]
Component Tree
Anyideas on how to edit the "stock" logos/images on the tree?
The Tree Component
hi everybody.
i made the "The Tree Component"-tutorial Lee-style, and as ever it worked perfectly for me.
so now, i've tried using it for a video-player i made, and the Tree component won't take any data at all.
i've got a bad feeling, that my problem is my preloader on frame 1 :shock:
i preload my file on the 1st frame using this code:
Code:
stop();
this.onEnterFrame = function() {
var amount:Number = this.getBytesLoaded() / this.getBytesTotal() * 100;
loader._xscale = amount;
if(amount == 100) {
this.gotoAndPlay(2);
delete this.onEnterFrame;
}
}
and on my 2nd frame i use this code:
Code:
stop();
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function() {
trace("bliver onload-funktionen kaldt?");
theTree.dataProvider = this.firstChild;
}
xml.load("tree.xml");
var treeL:Object = new Object();
treeL.change = function() {
trace("bliver onload-funktionen kaldt02?");
var item = theTree.selectedItem;
var earl = item.attributes.url;
if(earl) {
getURL(earl,"_self");
}
}
theTree.addEventListener("change",treeL);
function refreshListener(evt_obj:Object):Void {
trace("knasppen trykkes p?");
theTree.refresh();
}
refresh_button.addEventListener("click", refreshListener);
and YES, my Tree component IS called theTree :?
can it really be true, that the Tree component HAS to be used on the first frame?
or what have I done wrong?
thanks for replying
felisan
Using The Tree Component
I'm using the tree component to create a custom menu in my flash site. I have it looking the way I want and have it reading the XML data properly.
Trouble is, I'm confused as how to respond to the click events of my tree. Bassically I want to click on one of the tree items, then navigate within in my flash movie.
I know how to load in text and images from an external XML file, but I can't figure out how to write a simple onRelase event for the selected items in my tree.
Can anyone shed a little light on how this is done?
Thanks,
Randy
The Tree Component And XML
Hi,
When adding nodes to the Tree component, we can specify a data value. How can I access this value later?
Thanks,
|