Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fomatting text

Status
Not open for further replies.

janet24

Technical User
Jul 22, 2003
161
US
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>
 
to get a bullet into the caption text field


myFormat = new TextFormat();
myFormat.bullet = true;
//above has to be entered in section starting blank_mc._alpha = 100;



captionField_txt.setTextFormat(myFormat);
//make this the last line of code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top