A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: should this work??

  1. #1
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    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:
    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'>
    (single quotes to break the html parser on this site)
    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....
    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++;
    }
    Am I barking up completely the wrong tree, or just put a stupid syntax error in somewhere???

  2. #2
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    no, it shouldn't...sorry to waste anyone's time reading this post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center