Bonjour,
Je rencontre un problème. J'utilise Flash MX 2004.
En fait, le script fonctionne (je peux le tracer avec le debogueur)
mais certaines valeurs affectées par le script à mes objets, ne restent
pas lorsque l'on sort de la fonction...
Je ne comprends pas...
Voici le sript d'appel :
[...]
_root.galerie.pelicules.groupe["section"+section].fond["cat"+cat].onRelease = function() {
_root.galerie.current_section =
this.section+1;
_root.galerie.current_cat =
this.cat+1;
_root.galerie.bandeau.catLoad();
}
Et voici le script qui pose problème :
la valeur nb et le script onRelease sont présent lorsqu'on est dans la fonction, mais dès qu'on en sort, plus rien !
_root.galerie.bandeau.catLoad = function() {
_root.xml_cat_file =
_root.site+"scripts/categorie.php?section="+_root.galerie.current_section+"&categorie="+_root.galerie.current_cat;
_root.xml_cat = new XML();
_root.xml_cat.load(_root.xml_cat_file);
_root.xml_cat.onLoad = function() {
img = 0;
while (_root.xml_cat.childNodes[img] != null) {
if(img != 0) {
_root.galerie.bandeau.photos.photo0.duplicateMovieClip("photo"+img,img);
}
_root.galerie.bandeau.photos["photo"+img]._x += img *
(_root.galerie.largeur_photo + 10);
_root.galerie.bandeau.photos["photo"+img].nb = img+1; // c'est cette
valeur qui ne reste pas !!!
_root.galerie.bandeau.photos["photo"+img].loadMovie(_root.site+"images/galerie/"+_root.xml_section.childNodes[_root.galerie.current_section-1].attributes.name+"/"+_root.xml_section.childNodes[_root.galerie.current_section-1].childNodes[_root.galerie.current_cat-1].attributes.name+"/"+_root.xml_cat.childNodes[img].attributes.name);
_root.galerie.bandeau.photos["photo"+img].onRelease = function()
{ // le onRelease ne reste pas non plus !!!
_root.galerie.current_photo = this.photo;
_root.galerie.displayPhoto();
}
img++;
}
}
}
Je ne comprends pas pourquoi le fait de sortir de la fonction entraine
l'effacement des valeurs des objets, mais peut être que je n'ai pas
bien compris quelque chose ?
Merci pour votre aide.
Mickael