Morning everyone!
I’ve been working on a flash presentation for work. It’s pretty much a mini-site with links to PDF’s files and DOCS for distributors. I am feeding everything from an XML file so we can easily update this presentation for our other products.
I’ve run into a problem on the last part of this swf and I can’t seem to get the proper syntax to get this working properly. I am looping through the childNodes and creating MC and filling with data. I can loop through the first set of childNodes no problem. But its when one of these first set childNodes has a set of childNodes itself, I cant pair up that data with it’s parent on the flash movie.
So here’s my XML:
<page title="KIT CONTENTS">
<documents>
<doc title="Patient Instructions" file="pdf/patient_inst.pdf">Patient instructions are specifically designed with the patient in mind.</doc>
<doc title="Specimen Collection Tube" file="pdf/collectiontube.pdf">The patented specimen Collection Tube doubles as a convenient, sanitary dispenser.</doc>
<doc title="Return Mailer Kit" file="">This includes:
<list>
<bullet>Specific, detailed directions with colorful pictures to reduce ambiguity</bullet>
<bullet>Specimen Collection Tube and Collection Paper to obtain fecal sample</bullet>
<bullet>Absorbent sleeve, Specimen Pouch and Return Mailer box for mailing Collection Tube to doctor's office or laboratory</bullet>
</list>
</doc>
</documents>
<sidebar>
<bar title="Patient Instructions" image="images/p_inst.jpg" file="PatientInstructions.pdf"/>
<bar title="Specimen Collection Tube" image="images/ctube.jpg" file="collectiontube.pdf"/>
</sidebar>
</page>
And I cant line up the 3 items under the I cant seem to attach the bullet items to the movieclip that holds its parent info.
Here’s my AS for the loop:
for (var i = 0; i<dcount; i++) {
var item_mc = mcDocs.attachMovie("MC_Docs", "item"+item_count, item_count);
item_mc._y = item_count*item_spacing;
item_count++;
// If a Doc item has Bullets, loop and create the MC
if (docs.childNodes*.hasChildNodes()){
var list = docs.childNodes*.childNodes[1];
var bullet = list.childNodes;
var bitem = bullet.nodeValue;
for (var b = 0; b<dcount; b++) {
var list_mc = item_mc.attachMovie("MC_Bullet", "list"+list_count, list_count);
list_mc._y = list_count*list_spacing;
list_count++;
list_mc.txtBullet.text = list.childNodes**.childNodes;
}
}
// Dynamic Symbols for Doc Loop
item_mc.txtDocTitle.text = docs.childNodes*.attributes.title;
item_mc.txtDocIntro.text = docs.childNodes*.firstChild;
}
Is anyone able to show me what I’m doing wrong?
Here’s an image of what I am seeing:
TIA!