I have this action script that I'm using the load from an xml file. It works fine except that later we had to put bullets in the code of the caption. Is there any way to do that with what I have already or do I have to start over with the coding and the xml files.
blank_mc._alpha = 100;
my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.load("images1.xml");
my_xml.onLoad = function(status) {
if (status) {
// create the objects
var info_xml:Object = new Object();
info_xml = this.firstChild.firstChild.childNodes;
var totalSlides:Object = new Object;
totalSlides = info_xml.length;
var currentIndex:Number = new Number;
currentIndex = 1;
if (section==2)
{ // load picture into new movieclip
blank_mc.loadMovie(info_xml[3].attributes.source);
captionField_txt.text = info_xml[3].attributes.caption;
title_txt.text = info_xml[3].attributes.title;
subtitle_txt.text = info_xml[3].attributes.subtitle;
myImage = 3;
currentIndex=4;
section=0;
}
else
{ // load picture into new movieclip
blank_mc.loadMovie(info_xml[0].attributes.source);
captionField_txt.text = info_xml[0].attributes.caption;
title_txt.text = info_xml[0].attributes.title;
subtitle_txt.text = info_xml[0].attributes.subtitle;
}
}
_root.onEnterFrame = function() {
blank_mc._alpha =100;
}
};
// create an array of indexed images from the xml
var myImage:Array = new Array;
// next image
next_btn.onRelease = function() {
if (myImage < 3) {
myImage++;
blank_mc.loadMovie(info_xml[myImage].attributes.source);
captionField_txt.text = info_xml[myImage].attributes.caption;
title_txt.text = info_xml[myImage].attributes.title;
subtitle_txt.text = info_xml[myImage].attributes.subtitle;
currentIndex++;
}
else {gotoAndPlay(10);}
_root.onEnterFrame = function() {
blank_mc._alpha =100;
}
};
// previous image
prev_btn.onRelease = function() {
blank_mc._alpha = 100;
if (myImage > 0) {
myImage--;
blank_mc.loadMovie(info_xml[myImage].attributes.source);
captionField_txt.text = info_xml[myImage].attributes.caption;
title_txt.text = info_xml[myImage].attributes.title;
subtitle_txt.text = info_xml[myImage].attributes.subtitle;
currentIndex--;
}
_root.onEnterFrame = function() {
blank_mc._alpha =100;
}
};
XML FILE
<slides>
<slideshow>
<image source="images/sec_04_01.swf" caption="copy sample etc etc" title="DRRS/DRRS-A System Architecture" subtitle="DRRS Architecture"></image>
</slideshow>
</slides>
blank_mc._alpha = 100;
my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.load("images1.xml");
my_xml.onLoad = function(status) {
if (status) {
// create the objects
var info_xml:Object = new Object();
info_xml = this.firstChild.firstChild.childNodes;
var totalSlides:Object = new Object;
totalSlides = info_xml.length;
var currentIndex:Number = new Number;
currentIndex = 1;
if (section==2)
{ // load picture into new movieclip
blank_mc.loadMovie(info_xml[3].attributes.source);
captionField_txt.text = info_xml[3].attributes.caption;
title_txt.text = info_xml[3].attributes.title;
subtitle_txt.text = info_xml[3].attributes.subtitle;
myImage = 3;
currentIndex=4;
section=0;
}
else
{ // load picture into new movieclip
blank_mc.loadMovie(info_xml[0].attributes.source);
captionField_txt.text = info_xml[0].attributes.caption;
title_txt.text = info_xml[0].attributes.title;
subtitle_txt.text = info_xml[0].attributes.subtitle;
}
}
_root.onEnterFrame = function() {
blank_mc._alpha =100;
}
};
// create an array of indexed images from the xml
var myImage:Array = new Array;
// next image
next_btn.onRelease = function() {
if (myImage < 3) {
myImage++;
blank_mc.loadMovie(info_xml[myImage].attributes.source);
captionField_txt.text = info_xml[myImage].attributes.caption;
title_txt.text = info_xml[myImage].attributes.title;
subtitle_txt.text = info_xml[myImage].attributes.subtitle;
currentIndex++;
}
else {gotoAndPlay(10);}
_root.onEnterFrame = function() {
blank_mc._alpha =100;
}
};
// previous image
prev_btn.onRelease = function() {
blank_mc._alpha = 100;
if (myImage > 0) {
myImage--;
blank_mc.loadMovie(info_xml[myImage].attributes.source);
captionField_txt.text = info_xml[myImage].attributes.caption;
title_txt.text = info_xml[myImage].attributes.title;
subtitle_txt.text = info_xml[myImage].attributes.subtitle;
currentIndex--;
}
_root.onEnterFrame = function() {
blank_mc._alpha =100;
}
};
XML FILE
<slides>
<slideshow>
<image source="images/sec_04_01.swf" caption="copy sample etc etc" title="DRRS/DRRS-A System Architecture" subtitle="DRRS Architecture"></image>
</slideshow>
</slides>