Hi all,
I have been trying to work out how to get my actionscript to work with my XML but it is just beyond me. My XML is simple but long, sample below.
<category01>
<project01>
<project01title></project01title>
<project01description>project01description>
</project01>
<project02>
<project02title></project02title>
<project02description></project02description>
</project02>
</category01>
There are 15 categories and 30 projects in each category controlled through script in movie clips for each of the 15 categories. When the user clicks on a category on the left, the category thumbnail image set (30 buttons) pop up, then the user clicks a thumbnail, the categories project container goes to a point on the timeline to play that projects image loading script. Example below of what I have in there for project01.
[LEFT][COLOR=#f000f0]*//Load thumbnails and first of the large images into movieclip containers*[/COLOR]
[COLOR=#993300]loadMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]"resources/projects/default/thumbnail/project01_TN1.jpg"[/COLOR], [COLOR=#0000ff]"project01_TN1"[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#993300]loadMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]"resources/projects/default/thumbnail/project01_TN2.jpg"[/COLOR], [COLOR=#0000ff]"project01_TN2"[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#993300]loadMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]"resources/projects/default/thumbnail/project01_TN3.jpg"[/COLOR], [COLOR=#0000ff]"project01_TN3"[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#993300]loadMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]"resources/projects/default/large/project01_LG1.jpg"[/COLOR], [COLOR=#0000ff]"project01_LG"[/COLOR][COLOR=#000000])[/COLOR];[/LEFT]
[LEFT][COLOR=#f000f0]*//Load XML*[/COLOR]
[COLOR=#993300]var[/COLOR] project01_xml = [COLOR=#993300]new[/COLOR] [COLOR=#993300]XML[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
project01_xml.[COLOR=#993300]ignoreWhite[/COLOR] = [COLOR=#993300]true[/COLOR];
project01_xml.[COLOR=#993300]contentType[/COLOR] = [COLOR=#0000ff]"text/xml"[/COLOR];
project01_xml.[COLOR=#993300]onLoad[/COLOR] = [COLOR=#993300]function[/COLOR][COLOR=#000000]([/COLOR]success[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR][/LEFT]
[LEFT] [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]success[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#f000f0]*//target_dynamic_text_box.text = xml_node.nodeValue;*[/COLOR]
[COLOR=#f000f0]*//Puts the title in the title box and description in the description box*[/COLOR]
project01title.[COLOR=#993300]text[/COLOR] = [COLOR=#993300]this[/COLOR].[COLOR=#993300]firstChild[/COLOR].[COLOR=#993300]firstChild[/COLOR].[COLOR=#993300]firstChild[/COLOR].[COLOR=#993300]firstChild[/COLOR].[COLOR=#993300]nodeValue[/COLOR];
project01description.[COLOR=#993300]text[/COLOR] = [COLOR=#993300]this[/COLOR].[COLOR=#993300]firstChild[/COLOR].[COLOR=#993300]firstChild[/COLOR].[COLOR=#993300]firstChild[/COLOR].[COLOR=#993300]nextSibling[/COLOR].[COLOR=#993300]firstChild[/COLOR].[COLOR=#993300]nodeValue[/COLOR];
[COLOR=#000000]}[/COLOR] [COLOR=#993300]else[/COLOR] [COLOR=#000000]{[/COLOR]
project01title.[COLOR=#993300]text[/COLOR] = [COLOR=#0000ff]"Error"[/COLOR];
project01description.[COLOR=#993300]text[/COLOR] = [COLOR=#0000ff]"Error"[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR];
project01_xml.[COLOR=#993300]load[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]'resources/projects/xml/projectinfo.xml'[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#993300]stop[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];[/LEFT]
As you can see I just have a bunch of firstChild and nextSiblings if I keep going this way. I dont understand how to implement a loop to sort this out for me. Any help greatly appreciated.