[Xml,AS]problème graisse txt
Bonjour à tous,
j'ai mis en place un fichier xml dans lequel je charge des données (texte) pour les affichée dans mon fla.Bien evidemment dans mon fla, mon textfield est bien en html.
Mon problème est le suivant, je voudrais comme en html pouvoir changer facilement la graisse d'un mot. Par exemple, changer dans mon xml un mot en
<b>mon mot</b> et continuer avec une font normale par la suite
Je vous poste mon code pour voir si vous pouvez me filer un coup de main.
Car la quand je teste <b>mon mot</b>, ca ne me charge carrement pas le contenu.
Jespère avoir été clair.
Merci d'avance.
Bonne journée
Mon Action script simplifé.
Citation:
xmldata = 'galerie_fr.xml';
/////////////XML /////////////////////////////////////////////////////////////
var xml = new XML();
xml.ignoreWhite = true;
xml.load(xmldata);
xml.onLoad = function() {
var fichier:Array = new Array();
var theInfo:Array = new Array();
var images = xml.firstChild.childNodes;
for (id in images) {
theInfo[id] = images[id].attributes.info;
image = imgs.createEmptyMovieClip("image"+id, id);
}
var numOfPix:Number = images.length;
//////~~~ The text Format ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var theFmt:TextFormat = new TextFormat();
theFmt.align = "left";
theFmt.color = 0xFF6600;
theFmt.font = "Kartika";//Franklin Gothic Book
theFmt.size = 15;
theFmt.bold = false;
//
_level0.txt.selectable = false;
_level0.txt.setNewTextFormat(theFmt);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for (i=1; i<=numOfPix; i++) {
_level0.createTextField("theNum_txt", 1, 0, 0, w, h);
_level0.theNum_txt.text = i;
_level0.theNum_txt.setTextFormat(theFmt);
}
function pre_mvt() {
txt.text = theInfo[id];
}
next.onRelease = function() {
id++;
loading();
pre_mvt();
};
function loading() {
imgs.loadMovie("images/"+images[id].attributes.fichier);
_root.onEnterFrame = function() {
var totalBytes = imgs.getBytesTotal();
var loadedBytes = imgs.getBytesLoaded();
var percentDone = int((loadedBytes/totalBytes)*100);
if ((percentDone == 100) && (_root.haut.isTweening() == false) && (_root.flag == false)) {
bright();// ////////////////////////////////////////////////////////////////////////Action d'affichage de l'image
delete this.onEnterFrame;
_root.loading._visible = false;
}
};
}
};
Mon Xml
Citation:
<?xml version="1.0" encoding="utf-8" ?>
<galerie>
<image fichier="1.jpg" info="blablabla" />
<image fichier="2.jpg" info="The Second Car" />
<image fichier="3.jpg" info="The Third Car" />
<image fichier="4.jpg" info="The Fourth Car" />
<image fichier="5.jpg" info="The Fifth Car" />
<image fichier="6.jpg" info="The Sixth Car" />
</galerie>