Bonjour

j'ai donc fais une visionneuse avec cette 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
/*
*	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=10000;
	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();
	//monFichier.load("gallery.xml");
	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;
			thisClass.listePhoto=thisClass.maPhoto.childNodes;
			//thisClass.diaporama();
			//trace(thisClass.monFichier.firstChild.childNodes.length);
			//trace(thisClass.taille());
			//Afficher Auteur et date
			//trace("Constructeur XML");
			//Afficher la premiere photo
		}else{
			// erreur de chargement
			trace("Echec");
		}
	}
}
 
	//Afficher Auteur et date
	//Afficher la premiere photo
//Fonction taille
//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;
}
//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);
	_root.label_info.text=listePhoto[position].attributes.legend;
 
 
}
//Fonction premiere photo
public function premier(){
	position=0;
	afficher();
	}
//Fonction derniere photo
public function dernier(){
	position=listePhoto.length;
	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){
		return false;
	}else{
		return true;
	}
}
function diaporama(){
	chronoDiapo=setInterval(this, "diaporamaSuivant",delay);
}
function diaporamaSuivant(){
	if(estDernier()){
		clearInterval(chronoDiapo);
	}else{
		suivant();
	}
}
function arretDiapo(){
	clearInterval(chronoDiapo);
}
}
j'ai instancié cette classe
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
import fichierXML;
var monAlbum:fichierXML = new fichierXML();
mais je ne peux pas acceder aux méthodes via l'exterieur des accolades du onLoad
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
on (press){
	_root.label_info.text = "Lecture";
	_root.monALbum.suivant();
}
comment ça se fait ??

et que dois je faire pour y remedier ?

d'avance merci