Pour voir un aperçu cliquez ci-dessous :
<a href="
http://guercif.africa-web.org/AlbumPhotoArabeV2.html" target="_blank">
http://guercif.africa-web.org/AlbumPhotoArabeV2.html</a>
ce code est très interressant pour les webmaster des sites en arabe.
pour l'adapter a votre site il suffit de modifier le fichier XML ataché : AlbumPhotoArabeV2.xml pour indiquez les chemins de vos photos et aussi les interpretaions en arabe de chaque photo.
N.B : pour modifier ce fichier xml, il faut un editeur de xml qui gère la langue arabe; par exemple Altova XMLSpy , ou bien Microsoft Word; WordPad n'est pas utile car il transforme les caratères arabe en ?
s'il y a quelque choses n'est pas claire me contactez à : lakbir3@caramail.com
Source / Exemple :
_root.playlist == undefined ? playlist = "AlbumPhotoArabeV2.xml" : playlist=_root.playlist;
///////////////////////
///////////////////////
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = loadData;
data_xml.load(playlist);
numero = 1;
space = 10;
photo_mc._alpha = 0;
mouvT.mouv.controle.txtprecedent._visible=0;
mouvT.mouv.controle.txtsuivant._visible=0;
PloadPhoto = function(phota){
// this.loadMovie(phota);
if (phota._width>340){
phota._height = Math.round(phota._height * (340 / phota._width));
phota._width = 340;
}
if (phota._height>280){
phota._width = Math.round(phota._width * (280 / phota._height));
phota._height = 280;}
}
MovieClip.prototype.loadPhoto = function(photo){
photo_mc._alpha = 0;
this.loadMovie(photo);
_level0.onEnterFrame = function(){
// modified the total and loaded so as to round it up
// to smaller number.
var total = Math.round(photo_mc.getBytesTotal()/1024);
var loaded = Math.round(photo_mc.getBytesLoaded()/1024);
if (total != 0 && loaded>=total){
// PloadPhoto(photo_mc);
//ww.htmlText=photo_mc._width;
//hh.htmlText=photo_mc._height;
var w = photo_mc._width + space;
var h = photo_mc._height + space;
border.resize(w, h);
delete this.onEnterFrame;
}
}
};
MovieClip.prototype.resize = function(w, h){
//the higher the slower the resize of the border
var speed = 4;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1){
this._width = w;
this._height = h;
photo_mc._x = this._x - this._width/2 + space/2;
photo_mc._y = this._y - this._height/2 + space/2;
artxt._y=photo_mc._y +photo_mc._height+18;
txtimage._y=artxt._y -15;
photo_mc._alpha = 100;
delete this.onEnterFrame;
//border.resize(120,90) this.onEnterFrame;
}
}
};
function loadData(success) {
if (success) {
// showdisplay and playlist toggles
showDisplay = this.firstChild.attributes.showDisplay;
showPlaylist = this.firstChild.attributes.showPlaylist;
// getting all titles and filenames
tabimage = new Array();
tabtitre = new Array();
audioTracks = new Array();
audioTracks.shuffle();
audioTracks = this.firstChild.childNodes;
max = audioTracks.length;
for (var i = 0; i<max; i++) {
tabimage.push(audioTracks[i].attributes.imagename);
tabtitre.push(audioTracks[i].attributes.infotext);
autoStart = this.firstChild.attributes.autoStart;
}
// done ! all loaded succesfully. purging trash
delete audioTracks;
delete data_xml;
affichage(0);
//_root.image.loadMovie(tabimage[0]);
mouvT.mouv.controle.num.htmlText=numero;
mouvT.mouv.controle.maxa.htmlText=max;
mouvT.mouv.controle.precedent._visible=0;}
}
retourne = function() {
photo_mc._width=120;
photo_mc._height=90;
};
affichage= function(num) {
txtimage.htmlText = tabtitre[num];
//texte.htmlText = tabtexte[num];
photo_mc.loadPhoto(tabimage[num]);
//total = capture.getBytesTotal();
//pourcent = Math.floor((image.getBytesLoaded()/total)*100);
//if (pourcent == 100) {
//_root.image.loadMovie(tabimage[num]);
//pourcentage._visible=0;
//}
//pourcentage = pourcent+" % sur "+total+" ko";
// loadMovie(tabimage[num], "image");
//trace(tabtitre[num]);
trace(num);
}
mouvT.mouv.controle.suivant.onRelease = function() {
numero++;
affichage(numero-1);
mouvT.mouv.controle.precedent._visible=1;
mouvT.mouv.controle.num.htmlText=numero;
mouvT.mouv.controle.maxa.htmlText=max;
if (numero == (max)) {
mouvT.mouv.controle.suivant._visible=0;
}else { mouvT.mouv.controle.suivant._visible=1;}
};
mouvT.mouv.controle.precedent.onRelease = function() {
numero--;
affichage(numero-1);
mouvT.mouv.controle.num.htmlText=numero;
mouvT.mouv.controle.maxa.htmlText=max;
mouvT.mouv.controle.suivant._visible=1;
if (numero == 1) {
mouvT.mouv.controle.precedent._visible=0;
} else { mouvT.mouv.controle.precedent._visible=1;}
};
Conclusion :
plusieurs trucs qui sont en interface français on essai de le faire à interface arabe
prochainement un lecteur mp3 à interface arabe .
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.