Ok, this is a bit complex to explain, but the principle is probably quite simple, i just can't work it out.
the xml is in the format of:
(single quotes to break the html parser on this site)Code:<'main subnumber="4" mainheading="This is the main heading"'> <'subsection no="1" title="title 1" layout="1"'>This is subsection 1<'/subsection'> <'subsection no="2" title="title 2" layout="3"'> <'column no="1"'>first column text</column'> <'column no="1"'>second column text</column'> <'column no="1"'>third column text</column'> <'/subsection'> <'subsection no="3" title="title 3" layout="1"'>This is subsection 3<'/subsection'> <'/main'>
basically i've got a couple of mclips each with either a single text box, three text boxes in 3 columns or some other text box layout...what i want is to be able to tell one of those clips to play,and to load one of the <'subsection'> blocks. which clip that plays being specified by the 'layout' attribute, and which subsection the mclip gets it's text from is specified by the 'no' attribute.
I thought i'd worked it out and put this into the mclips....
Am I barking up completely the wrong tree, or just put a stupid syntax error in somewhere???Code:var attNumb = _root.content.childNodes.attributes.no; //get the attribute "no" var children =_root.content.childNodes.length; //get the number of subsections var x = 0; for ( attNumb in children) { if ( attNumb == _root.subNumber){ //subsections are defined by which button is clicked //therefore attNumb == _root.subNumber as set by a button column1=_root.content.childNodes[x].nodeValue; break; } x++; }




Reply With Quote