var items = _root.ifob_xml.firstChild.firstChild.childNodes;
if (items[1].attributes.name == "Features and Benefits") {
//Page Variable Declarations
var page = items[1].childNodes[0];// Page Title
var docs = page.firstChild;// Doc Node
var sidebar = page.childNodes[1];// Sidebar Node
var bar = sidebar.childNodes;
var footer = page.lastChild;
// Count Nodes to help test and get direct variable paths
var dcount:Number = docs.childNodes.length;
var scount:Number = sidebar.childNodes.length;
var fcount:Number = footer.childNodes.length;
// MC Duplicating Paramters
var item_count = 0;
var side_count = 0;
var side_spacing = 170;
var footer_count = 0;
// Create the Document Loop
for (var i = 0; i<dcount; i++) {
var item_mc = this.mcDocs.attachMovie("MC_Docs", "item_mc"+item_count, item_count);
item_mc._x = x;
item_mc._y = curHeight;
// Dynamic Symbols for Doc Loop
item_mc.txtDocTitle.text = docs.childNodes[i].attributes.title;
item_mc.iurl = docs.childNodes[i].attributes.file;
item_mc.txtDocIntro.wordWrap = true;
item_mc.txtDocIntro.width = 548;
item_mc.txtDocIntro.autoSize = "center";
// If a node is empty, it wont fill the text box with "null"
if (docs.childNodes[i].firstChild.nodeValue == null){
item_mc.txtDocIntro.htmlText = "";
} else {
item_mc.txtDocIntro.html = true;
item_mc.txtDocIntro.htmlText = docs.childNodes[i].firstChild;
}
// If a Doc item has Bullets, loop and create the MC
if (docs.childNodes[i].hasChildNodes()){
var list_count = 0;
var list = docs.childNodes[i].childNodes[1];
var lcount:Number = list.childNodes.length;
var curBHeight:Number = 0;
item_mc.mcBullet._y = item_mc.txtDocIntro._height - item_mc.txtDocIntro._y - 15;
for (var b = 0; b<lcount; b++) {
var list_mc = item_mc.mcBullet.attachMovie("MC_Bullet", "list_mc"+list_count, list_count);
list_mc._x = x;
list_mc._y = curBHeight;
//Dynamic Text Box Assignments
list_mc.txtBullet.wordWrap = true;
list_mc.txtBullet.width = 528;
list_mc.txtBullet.autoSize = "center";
list_mc.txtBullet.html = true;
list_mc.txtBullet.htmlText = list.childNodes[b].childNodes;
curBHeight = list_mc._y + list_mc._height;
list_count++;
}
} else {
list_mc._height = 0;
}
curHeight = item_mc._y + item_mc._height;
item_count++;
}
// Check for the a Sidebar node
if(page.childNodes[1].nodeName == "sidebar"){
// Create the Sidebar Loop if found
for (var s = 0; s<scount; s++) {
var side_mc = mcSide.attachMovie("MC_SideBar", "side"+side_count, side_count);
side_mc._y = side_count*side_spacing;
side_count++;
// Dynamic Symbols for sidebar Loop
side_mc.txtSBItem.text = bar[s].attributes.title;
side_mc.mcSBGfx.loadMovie(bar[s].attributes.image);
side_mc.url = bar[s].attributes.file;
side_mc.onRelease = released;
// Variables to execute On Click for PDF Links
side_mc.onRelease = function(){
getURL(this.url, "_blank");
_root.mcFile.gotoAndPlay("Fadein");
};
// Activate Rollover for Tooltips
side_mc.onRollOver = function() {
mcToolTip.gotoAndStop(2);
}
side_mc.onRollOut = function() {// hide it again
mcToolTip.gotoAndStop(1);
}
}
//trace("A sidebar has been found");
} else {
removeMovieClip(this.mcSide);
//trace("No Sidebar");
}
// Check for a footer Node, if available, create the footer items
if (page.lastChild.nodeName == "footer"){
var curFHeight:Number = 0;
for (var f = 0; f<fcount; f++) {
var footer_mc = item_mc.mcFooter.attachMovie("MC_itemFooter", "footer_mc"+footer_count, footer_count);
footer_mc._x = 0;
footer_mc._y = curFHeight;
//Dynamic Text Box Assignments
footer_mc.txtfNum.text = footer.childNodes[f].attributes.number;
footer_mc.txtfCopy.html = true;
footer_mc.txtfCopy.autoSize = "Center";
footer_mc.txtfCopy.width = 528;
footer_mc.txtfCopy.htmlText = footer.childNodes[f].firstChild;
curFHeight = footer_mc._y + footer_mc._height;
footer_count++;
}
}
//Dynamic Text Box Assignments
txtPageTitle.autoSize = "Center";
txtPageTitle.width = 548;
txtPageTitle.text = page.attributes.title;
//Help Test Node and Var references
//trace("there are "+dcount+" entries in your XML");
//trace("there are "+lcount+" entries in your XML");
//trace("curHeight ="curHeight);
//trace("curFHeight ="+curFHeight);
//trace(sidebar);
}
_root.scrollPane.invalidate();