bonjour

voila j'ai fait une visionneuse a photo mais la premiere photo ne prend pas les parametres de taille ?? Ma viosnneuse

j'appelle ma classe comme ça

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
//Instanciation de la classe
	import fichierXML;
	var monAlbum:fichierXML = new fichierXML();
et bouton suivant
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
on (press){
	_root.monAlbum.suivant();
}
ma classe
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
*	Classe Fichier XML
*	pour visionneuse photo
*
*	KarKam Dvpt.
*	Juin 2007
*/
 
//Definition de la classe fichier XML
class fichierXML {
	public var monFichier:XML;
	public var maPhoto:XMLNode;	
	public var listePhoto:Array;
	public var position :Number;
	public var album:String;
	public var delay:Number;
	public var chronoDiapo:Number;
//Constructeur de la classe
public function charger (srcAlbum:String){
	position=0;
	album=srcAlbum;
	monFichier = new XML();
	monFichier.ignoreWhite=true;
	listePhoto = new Array();
	var thisClass:fichierXML=this;//on crée une reférence local de l'instance de la class
	// [...]
	monFichier.load("http://karkam.free.fr/album/"+album+"/gallery.xml");
	monFichier.onLoad=function(succes:Boolean){
		if(succes==true){
			thisClass.maPhoto=thisClass.monFichier.firstChild;
			_root.label_author.text=thisClass.maPhoto.attributes.author+" publié le "+thisClass.maPhoto.attributes.date
			thisClass.delay=thisClass.maPhoto.attributes.delay;
			thisClass.listePhoto=thisClass.maPhoto.childNodes;
			_root.label_info.color=thisClass.maPhoto.attributes.textColor;
			thisClass.afficher();
 
		}else{
			// erreur de chargement
			trace("Echec");
		}
	}
}
//Retourne le nombre de photo
public function taille ():Number {
	return listePhoto.length;
}
//Fonction retourne le numéro de la photo courante
public function numeroPhoto():Number{
	return position+1;
}
//Fonction afficher photo et légende courants
public function afficher(){
 
	_root.mc.loadMovie("http://karkam.free.fr/album/"+album+"/images/"+listePhoto[position].attributes.filename,_root.mc);
	//Taille visionneuse
	_root.mc._x=200;
	_root.mc._y=70;
	_root.mc._xscale=320;
	_root.mc._yscale=240;
	_root.mc._width=320;
	_root.mc._height=240;
	_root.label_info.text=listePhoto[position].attributes.legend;
	_root.label_numpage.text=numeroPhoto()+"/"+taille();
 
}
//Fonction premiere photo
public function premier(){
	position=0;
	afficher();
	}
//Fonction derniere photo
public function dernier(){
	position=listePhoto.length-1;
	afficher();
}
//Fonction photo suivante
public function suivant(){
	if(!estDernier()){
	   position++;
	   afficher();
	}
}
//Fonction photo précédente
public function precedent(){
	if(!estPremier()){
		position--;
		afficher();
	}
}
//Fonction photo précédente
public function estPremier():Boolean{
	if(position!=0){
		return false;
	}else{
		return true;
	}
}
//Fonction photo précédente
public function estDernier():Boolean{
	if(position<listePhoto.length-1){
		return false;
	}else{
		return true;
	}
}
function diaporama(){
	chronoDiapo=setInterval(this, "diaporamaSuivant",delay);
}
function diaporamaSuivant(){
	if(estDernier()){
		clearInterval(chronoDiapo);
	}else{
		suivant();
	}
}
function arretDiapo(){
	clearInterval(chronoDiapo);
}
}