Flash 8 duplicating movie clips and setting 3 nodes from XML. I am trying to read in an xml with 3 parameters; 2 links and one text field for a caption. What am I doing wrong this time?
AS:
MovieClip.prototype.easeY = function(y) {
this.onEnterFrame = function() {
this._y = y-(y-this._y)/1.2;
if(Math.abs(y-this._y) <=1) {
delete this.onEnterFrame;
this._y = y;
}
}
}
options = new Array();
xml_file = "options.xml";
xml = new XML ();
xml.ignoreWhite = true;
xml.onLoad = function(ok){
if(ok){
count = this.firstChild.childNodes.length;
for(var i=0;i<count;i++){
curNode = this.firstChild.childNodes*;
options* = {caption:curNode.childNodes[0].firstChild.nodeValue, link1:curNode.childNodes[1].firstChild.nodeValue, link2:curNode.childNodes[2].firstChild.nodeValue};
}
boot();
} else {
trace("Could not Load"+xml_file+".");
}
};
xmlload.load(xml_file);
spacing = 10;
boot = function () {
for (var i=0;i<options.length;i++) {
mc = contain2.attachMovie("bMC" , "b" + i ,i);
mc._y = i * (10+spacing);
mc.buttText.buttonText.text = options*.caption;
mc.link1 = options*.link1;
mc.link2 = options*.link2;
}
setRollOver();
}
setRollOver = function () {
this.onEnterFrame = function() {
if(this.mask.hitTest(_root._xmouse,_root._ymouse)){
slideMenu();
}
}
}
slideMenu = function() {
diffspacing =20;
diff = this._parent._ymouse - (this._y+diffspacing);
scale = diff*100/(this.mask._height-2*diffspacing);
scale = Math.max(0,Math.min(100,scale));
target = -scale*(this.container._height-this.mask._height)/100;
this.container.easeY(target);
}
XML:
[SIZE=2]<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<options>
<option>
<caption>Mix 1</caption>
<link1>www.msn.com</link1>
<link2>www.msn.com</link2>
</option>
<option>
<caption>Mix 1</caption>
<link1>www.msn.com</link1>
<link2>www.msn.com</link2>
</option>
<option>
<caption>Mix 1</caption>
<link1>www.msn.com</link1>
<link2>www.msn.com</link2>
</option>
<option>
<caption>Mix 1</caption>
<link1>www.msn.com</link1>
<link2>www.msn.com</link2>
</option>
<option>
<caption>Mix 1</caption>
<link1>www.msn.com</link1>
<link2>www.msn.com</link2>
</option>
</options>
[/SIZE]
I am trying to have “bMC” load into and repeater for however many XML props there are. within “bMC” are two MC’s that on click would open window or grab file and One Text field which would load in caption. For some reason the “bMC” isnt even loading at all. Attached is the .Fla any help is appreciated. Thanks in advance.