Bonjour j'ai un systeme de news que j'ai télécharger sur activeden.net
cependant lorsque je met des accens dans mon fichier xml, il n'apparaisse pas dans mon SWF
voici mon code xml :
et voici le code flash:
voici les fichiers source : http://rapidshare.com/files/355102391/fichier.zip
merci de votre aide
[/i][/i][/i][/i]
Modifié par thanos125 (26 Feb 2010 - 09:22)
cependant lorsque je met des accens dans mon fichier xml, il n'apparaisse pas dans mon SWF
voici mon code xml :
<?xml version="1.0" encoding="UTF-8" ?>
<NEWS>
<item>
<date day="10" month="AVR"/>
<title>10 et 11 Avril 2010 </title>
<description>école à çè é
</description>
</item>
</NEWS>
et voici le code flash:
stop();
// ************ Configuration *********************** //
var introSpeed:Number = 0.9;
var itemSpacing:Number = 20;
// Number of items to show at any one time
var noItems:Number = 2;
// ************ End of Configuration *************** //
// neeed classes
import mx.transitions.Tween;
import mx.transitions.easing.*;
// set scope
scope = this;
// create empty mc to build everything in.
scope.createEmptyMovieClip("news", 400);
news._x = 40;
news._y = 60;
var id:Number = 0;
// nav
var newsNav:MovieClip = scope.createEmptyMovieClip("newsNav", 600);
newsNav._x = 370;
newsNav._y = 270;
fade(newsNav, 0, 100, 1.6, Strong.easeOut);
var olderBtn:MovieClip = newsNav.attachMovie("oldBtn", "oldBtn", 602);
olderBtn.txt.t.text = "SUIV";
olderBtn._x = 142;
var newerBtn:MovieClip = newsNav.attachMovie("newBtn", "newBtn", 601);
newerBtn.txt.t.text = "PREC";
newerBtn._x = 95;
// disable newerBtn
newerBtn._alpha = 50;
colorChange(newerBtn.txt, activeColor, disableColor, 0.1);
newerBtn.enabled = false;
// Load XML
var mainNews:XML = new XML();
mainNews.ignoreWhite = true;
mainNews.onLoad = buildnews;
mainNews.load("news.xml");
function buildnews(success:Boolean):Void {
if (success) {
var allNews:XMLNode = mainNews.firstChild;
var allNewsTotal:Number = allNews.childNodes.length;
var newsTitle:MovieClip = scope.attachMovie("title", "title", 501);
newsTitle._x = 35;
newsTitle._y = 20;
fade(newsTitle, 0, 100, 1.9, Strong.easeOut);
var topMask:MovieClip = scope.attachMovie("mask", "topMask", 500);
topMask._x = 40;
topMask._y = 40;
news.setMask(topMask);
var i:Number;
for (i=0; i<allNewsTotal; i++) {
var newsItem:MovieClip = news.attachMovie("newsItem", "newsItem"+i, i);
// get xml info
newsItem.nDay = allNews.childNodes[i].childNodes[0].attributes.day;
newsItem.nMonth = allNews.childNodes[i].childNodes[0].attributes.month;
newsItem.nTitle = allNews.childNodes[i].childNodes[1].firstChild.nodeValue;
newsItem.des = allNews.childNodes[i].childNodes[2].firstChild.nodeValue;
newsItem.iTitle.iText.text = newsItem.nTitle;
newsItem.sDes.sText.text = newsItem.des;
newsItem.sDes.sText.autoSize = true;
newsItem.nDate.nDay.text = newsItem.nDay;
newsItem.nDate.nMonth.text = newsItem.nMonth;
// intro for newsItem + positioning
newsItem._x = 0;
newsItem.pos = scope.news['newsItem'+(i-1)]._y+scope.news['newsItem'+(i-1)]._height+itemSpacing;
newsItem._y = newsItem.pos;
if (i<noItems) {
// show the first news items
fade(newsItem, 0, 100, introSpeed+i*0.6, Strong.easeInOut);
} else {
// hide other itmes
newsItem._alpha = 0;
}
}
olderBtn.onRelease = function():Void {
if (id>=0 && id<allNewsTotal-noItems) {
newerBtn._alpha = 100;
newerBtn.enabled = true;
var a:Number = id+noItems;
slide(news, news._y, news._y-scope.news['newsItem'+id]._height-itemSpacing, 0.7, "_y");
fade(scope.news['newsItem'+id], 100, 0, 2.2, Strong.easeOut);
fade(scope.news['newsItem'+a], 0, 100, 1.5, Strong.easeInOut);
if (id == 0) {
colorChange(newerBtn.txt, disableColor, normalColor, 1);
}
id++;
}
if (id == allNewsTotal-noItems) {
this.enabled = false;
this._alpha = 50;
slide(this.plus, 5, 50, 0.5, "_y");
}
};
olderBtn.onRollOver = function():Void {
slide(this.plus, 50, 5, 0.5, "_y");
fade(this.plus, 0, 100, 1, Strong.easeOut);
};
olderBtn.onRollOut = function():Void {
slide(this.plus, 5, 50, 0.5, "_y");
fade(this.plus, 100, 0, 1, Strong.easeOut);
};
newerBtn.onRelease = function():Void {
if (id<allNewsTotal && id>0) {
olderBtn._alpha = 100;
olderBtn.enabled = true;
var b:Number = id-1;
var c:Number = id+noItems-1;
slide(news, news._y, news._y+scope.news['newsItem'+b]._height+itemSpacing, 0.7, "_y");
fade(scope.news['newsItem'+b], 0, 100, 1.5, Strong.easeInOut);
fade(scope.news['newsItem'+c], 100, 0, 1.2, Strong.easeOut);
id--;
}
if (id == allNewsTotal-(noItems+1)) {
colorChange(olderBtn.txt, disableColor, normalColor, 1);
}
if (id == 0) {
this.enabled = false;
this._alpha = 50;
slide(this.minus, 5, 50, 0.5, "_y");
}
};
newerBtn.onRollOver = function():Void {
slide(this.minus, 50, 5, 0.5, "_y");
fade(this.minus, 0, 100, 1, Strong.easeOut);
};
newerBtn.onRollOut = function():Void {
slide(this.minus, 5, 50, 0.5, "_y");
fade(this.minus, 100, 0, 1, Strong.easeOut);
};
} else {
trace("XML NOT LOADED");
}
}
// tween functions
function fade(who:MovieClip, startvalue:Number, endvalue:Number, fade_speed:Number, ease) {
var fader:Tween = new Tween(who, "_alpha", ease, startvalue, endvalue, fade_speed, true);
}
function slide(who:MovieClip, startvalue:Number, endvalue:Number, y_speed:Number, prop:String) {
var slider:Tween = new Tween(who, prop, Strong.easeInOut, startvalue, endvalue, y_speed, true);
}
voici les fichiers source : http://rapidshare.com/files/355102391/fichier.zip
merci de votre aide
[/i][/i][/i][/i]
Modifié par thanos125 (26 Feb 2010 - 09:22)