Ask a Question related to Macromedia Flash Data Integration, Design and Development.
-
cLeAnEr #1
XML nested Loop?
hi all.
I´ve just completed a little test for making a tree component with custom
icons / bransch.
However, i can only get my first branch to show custom icons.(links -
document) I figure I need to make a nested loop to Iterate over
nextSibling?. I tried ALOT, but i guess I´m doing something completely
wrong.
here is code for my tree so far:
my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.load("tree.xml");
my_xml.onLoad = function(){
myTree.dataProvider = this.firstChild;
var folders = my_xml.firstChild.firstChild;
var docs = folders.childNodes;
for (var i=0; i < docs.length; i++){
currDoc = docs[i];
trace(docs[i]);
var docIcon = currDoc.attributes.pic;
switch(docIcon){
case "pdf":
myTree.setIcon(currDoc, "pdfIcon");
break;
case "word":
myTree.setIcon(currDoc, "wordIcon");
break;
case "excel":
myTree.setIcon(currDoc, "excelIcon");
break;
case "ie":
myTree.setIcon(currDoc, "ieIcon");
break;
}//switch
} //for
};//onLoad
And here is the XML I used:
<node label="» Dokument typer">
<node label="» links - document">
<node label="test.url" url="http://www." pic="ie" info="test text" />
<node label="test.doc" url="test.doc" pic="word" info="test text" />
<node label="test.excel" url="test.xls" pic="excel" info="test text" />
<node label="test.pdf" url="test.pdf" pic="pdf" info="test text." />
</node>
<node label="» Links - document">
<node label="test URL" url="http://www." pic="ie" info="test text." />
<node label="test URL" url="http://www." pic="ie" info="test text." />
</node>
</node>
cLeAnEr Guest
-
#40768 [NEW]: nested foreach break -- infinite loop - serious
From: rave235 at gmail dot com Operating system: winxp PHP version: 5.2.1 PHP Bug Type: Scripting Engine problem Bug... -
Nested Loop
Hi I am attempting to output this data using a table but things do output very well. Do I need nested looping. Thanks <table width='100%'... -
Nested loop woes.
Hi, I am quite new to using Director and am having some trouble with some nested loops. I am trying to create a drum machine, whereby users... -
Film loop rollovers working with tell sprite, but only if Loop is checked
on mouseWithin me cursor 280 tell sprite 40 --the sprite containing the film loop sprite(60).member = member("networkmapsbuttonroll") --swapping... -
Question on Dynamic Array/Nested Loop approach
Hello, I have the following code which populates as table data from a SQL Server 2000 stored proc (RSByDemoID2). Below that is the view and... -
cLeAnEr #2
Re: XML nested Loop?
Solved it ..works nicely :D
ty anyways.
//cleaner
"cLeAnEr" <niclas.meyer@vesam.se> skrev i meddelandet
news:ekm1vc$r8h$1@forums.macromedia.com...> hi all.
>
> I´ve just completed a little test for making a tree component with custom
> icons / bransch.
> However, i can only get my first branch to show custom icons.(links -
> document) I figure I need to make a nested loop to Iterate over
> nextSibling?. I tried ALOT, but i guess I´m doing something completely
> wrong.
>
>
> here is code for my tree so far:
>
> my_xml = new XML();
> my_xml.ignoreWhite = true;
> my_xml.load("tree.xml");
>
> my_xml.onLoad = function(){
> myTree.dataProvider = this.firstChild;
>
>
> var folders = my_xml.firstChild.firstChild;
> var docs = folders.childNodes;
>
> for (var i=0; i < docs.length; i++){
> currDoc = docs[i];
> trace(docs[i]);
>
> var docIcon = currDoc.attributes.pic;
>
> switch(docIcon){
> case "pdf":
> myTree.setIcon(currDoc, "pdfIcon");
> break;
> case "word":
> myTree.setIcon(currDoc, "wordIcon");
> break;
> case "excel":
> myTree.setIcon(currDoc, "excelIcon");
> break;
> case "ie":
> myTree.setIcon(currDoc, "ieIcon");
> break;
> }//switch
> } //for
> };//onLoad
>
>
> And here is the XML I used:
>
> <node label="» Dokument typer">
> <node label="» links - document">
> <node label="test.url" url="http://www." pic="ie" info="test text" />
> <node label="test.doc" url="test.doc" pic="word" info="test text" />
> <node label="test.excel" url="test.xls" pic="excel" info="test text" />
> <node label="test.pdf" url="test.pdf" pic="pdf" info="test text." />
> </node>
> <node label="» Links - document">
> <node label="test URL" url="http://www." pic="ie" info="test text." />
> <node label="test URL" url="http://www." pic="ie" info="test text." />
> </node>
> </node>
>
cLeAnEr Guest
-
Pinnennet #3
RE: XML nested Loop?
Well now im sitting here 3 years later with the same problem. Is there someway i could get a completed version of the code please? Anyone
Posted via DevelopmentNow.com Group
[url]http://www.developmentnow.com/g/[/url]
Pinnennet Guest



Reply With Quote

