Ok, so I have a side scroller, I’m trying to load seperate images, titles, and descriptions into an arrayed movie clip. I have it loading the first movieClip (scrollerMovie) just fine, as well as the 2nd one (nextImage is doing this. If I ad a p++; to the firstImage function, it puts the loaded part into the 2nd movieclip and then loads in the 3rd part, however I can only 2 of my arrays on the swf at any given time, how do I load into all of my MovieClips in the array? ANy help would be GREAT! And then also, my buttons don’t move my swf left and right how do I assign them to the movieclip array? And how do I set that array length dynamically for the buttons so I can stop the array at the end of it’s array when I’m scrolling left or right with my buttons?
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
title = [];
link = [];
btn = [];
total = xmlNode.childNodes.length;
var xPos = 36;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
title* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
link* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
btn* = xmlNode.childNodes*.firstChild.nodeValue;
var scrollerMovie = attachMovie("scrollerMovie", "new"+i, i, {_x:xPos, _y:40});
xPos += scrollerMovie._width+20;
}
firstImage();
nextImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
p = 0;
function firstImage() {
this["new"+p].picture.loadMovie(image[0], 1);
this["new"+p].desc_txt.text = description[0];
this["new"+p].title_txt.text = title[0];
}
function nextImage() {
p++;
this["new"+p].picture.loadMovie(image[p], 1);
this["new"+p].desc_txt.text = description[p];
this["new"+p].title_txt.text = title[p];
}
leftBtn.onRelease = function(){
easeType = mx.transitions.easing.Bounce.easeOut;
var begin = 45;
var end = 270;
var time = 2.5;
var mc = this["new"+p];
this["new"+p] = new mx.transitions.Tween(mc, "_X", easeType, begin, end, time, true); // PUT ALL OF THAT ON ONE LINE
}
rightBtn.onRelease = function(){
easeType = mx.transitions.easing.Bounce.easeOut;
var begin = 270;
var end = 45;
var time = 2.5;
var mc = this["new"+p];
this["new"+p] = new mx.transitions.Tween(mc, "_X", easeType, begin, end, time, true); // PUT ALL OF THAT ON ONE LINE
}