Hi All,
I am working on a cbt that has a set of 70 jpg’s and defined time intervals. I have worked out the XML which loads into the fla, but i am not able to write a function that would change the images at defined intervals. Please can any one help me on this. Its important.
Thanks in advance.
Here is the XML Structure.
<content>
<Video image_url=“Images/Image01.jpg” image_duration=“5”></Video>
<Video image_url=“Images/Image02.jpg” image_duration=“10”></Video>
</content>
And here is the code that loads the image in an empty movieclip.
var imageArray1 = new Array();
var imageArray2 = new Array();
//Load XML
var content:XML = new XML();
content.ignoreWhite = true;
content.onLoad = function(ok) {
total1 = content.firstChild.childNodes.length;
for (var i = 0; i<total1; ++i) {
imageArray1* = new Object();
imageArray2* = new Object();
imageArray1* = content.firstChild.childNodes*.attributes.image_url;
//trace(imageArray1*);
imageArray2* = content.firstChild.childNodes*.attributes.image_duration;
//trace(imageArray2*);
loadImage();
}
firstImage();
//trace(“loaded”);
};
content.load(“images.xml”);
function loadImage() {
for (var i = 0; i<total1; ++i) {
_root.holder_mc.loadMovie(imageArray1*);
}
}
function changeImage() {
setInterval(loadImage,imageArray2*);
trace(imageArray2*);
}
//Loading the First Image
function firstImage() {
_root.holder_mc.loadMovie(imageArray1[0]);
}