Hi all,
I have a scrolling image strip that loads images from xml. I was wondering how I could attach a border to the movie clips that the images are loaded into. I know how to use the drawing API, but I can’t seem to attach a border to each movie clip. I’m posting the code below. Any help would be greatly appreciated. Thanks.
cliparray = [];
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
thumbnails* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
thumbnails_fn(i);
}
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
var pause3;
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 20;
var tot = 0;
var fun1 = function(){
tscroller.onEnterFrame = function() {
for (var obj in cliparray) {
cliparray[obj]._x -= scroll_speed;
}
if (cliparray[0]._x< -200) {
cliparray[0]._x = cliparray[cliparray.length-1]._x+cliparray[cliparray.length-1]._width+10;
var j = cliparray.splice(0, 1);
cliparray = cliparray.concat(j);
}
clearInterval(pause1);
};
}
pause1 = setInterval(fun1,2000);
pause3 = setInterval(fun2,2404);
function fun2(){
tscroller.onEnterFrame = null;
clearInterval(pause3);
pause1 = setInterval(fun1,2000);
}
pause3 = setInterval(fun2,2404);
function thumbnails_fn(k) {
var yy = thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
cliparray.push(yy);
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = 5+(target_mc._width+10)*k;
target_mc.pictureValue = k;
tot += target_mc._x;
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}