The function below belongs to an XML based photoGallery.swf… Its menu is automatically populated from the same XML file as well (thumbnail picture, title, description). The pictures load into an empty mc called imageContainer.
In another empty mc called textContainer, I would like to load some text.swf from the xml list as well.
[SIZE=3][COLOR=blue]==> QUESTION: How would you include that in the code?[/COLOR][/SIZE] My brain is pooped out right now, so I can really use some help. (XML is NOT my forte #_#)
function loadTmbs () {
var tmbs:XML = new XML ();
tmbs.ignoreWhite = true;
tmbs.onLoad = function (success) {
if (success) {
var root:XMLNode = this.firstChild;
for (i = 0; i < root.childNodes.length; i++) {
var titleTxt:String = root.childNodes*.childNodes[0].childNodes[0].nodeValue;
var descTxt:String = root.childNodes*.childNodes[1].childNodes[0].nodeValue;
var thumbs:String = root.childNodes*.childNodes[2].childNodes[0].nodeValue;
var images:String = root.childNodes*.childNodes[3].childNodes[0].nodeValue;
imagesArr.push (images);
mainmenu.containerTmbs.attachMovie ("tmb","tmb" + i,i);
mainmenu.containerTmbs["tmb" + i]._y = i * 80;
loadMovieClip (thumbs,mainmenu.containerTmbs["tmb" + i].containerTmb);
mainmenu.containerTmbs["tmb" + i].titleLabel.titleText.htmlText = titleTxt
mainmenu.containerTmbs["tmb" + i].descLabel.descText.htmlText = descTxt
mainmenu.containerTmbs["tmb" + i].bt.idInstance = i;
mainmenu.containerTmbs["tmb" + i].bt.onRelease = function () {
cursorArr = this.idInstance;
ZigoEngine.doTween (imageContainer,'_alpha',0,1,"easeOutExpo",0,function () {
loadBitmapSmoothed (imagesArr[cursorArr],imageContainer);
});
};
}
}
loadBitmapSmoothed (imagesArr[cursorArr],imageContainer);
intro ();
mainmenu.containerTmbs._y = 0 - mainmenu.containerTmbs.height / 2;
};
tmbs.load ("photoGallery.xml");
}
function updateMovies () {
d = 10;
mov = _root._ymouse;
coef = (Stage.height - (mainmenu.containerTmbs._height + 180)) / Stage.height;
mainmenu.containerTmbs._y -= (((mainmenu.containerTmbs._y-35) + Stage.height/2) - coef * mov) / d;
}
This is how my xml file looks like:
<gallery>
<images>
<title><![CDATA[LUMINOUS LOTION]]></title>
<description><![CDATA[INDIGO RADIANCE PRIMER]]></description>
<tmb>tmb1.jpg</tmb>
<img>img1.jpg</img>
<txt>text1.swf</txt>
</images>
<images>
<title><![CDATA[ALTERNATIVE SERUM]]></title>
<description><![CDATA[INDIGO INJECTION ALTERNATIVE]]></description>
<tmb>tmb2.jpg</tmb>
<img>img2.jpg</img>
<txt>text2.swf</txt>
</images>
</gallery>