flash8 et xml: onRelease impossible sur des vignettes
bonjour,
j'aimerai faire un diaporama en flash pour mon site. Voila comment il fonctionne:
quand on clique sur un menu, un script XML charge des vignettes. Quand on clique sur une de ces vignettes, le XML permet de charger la grande image correspndant. Mais pour l'instant quand quand je clique sur les vignettes rien ne se passe
alors voila le code:
XML(au cas ou...)
Code:
1 2 3 4 5 6 7 8
|
<?xml version="1.0" encoding="utf-8"?>
<illustrations>
<illustration nom="ma blonde" chemin="img/min/mablonde_min.jpg" y="+300" pic="img/kate.jpg" />
<illustration nom="jour de pluie" chemin="img/min/jourdepluie_min.jpg" y="+110" pic="img/jourdeplie.jpg" />
<illustration nom="innitials BB" chemin="img/min/bb_min.jpg" y="+110" pic="img/innitialsbb1/jpg" />
<illustration nom="affiche" chemin="img/min/polar_min.jpg" y="+330" pic="polar_mini.jpg" />
</illustrations> |
actionscript
Code:
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
|
//je créé un mc gris foncé qui couvre toute la scène
this.createEmptyMovieClip('cache_mc', 22)
cache_mc._alpha=0;
cache_mc.lineStyle(1, 0x999999);
cache_mc.beginFill(0x999999);
cache_mc.moveTo(0, 0);
cache_mc.lineTo(0, 700);
cache_mc.lineTo(800,700);
cache_mc.lineTo(800, 0);
cache_mc.lineTo(0, 0);
cache_mc.endFill();
this.onEnterFrame = function (){
if(cache_mc._alpha<80){
cache_mc._alpha+=5
}
pack_mc._y=1005
flyers_mc._y=1005
illustration_mc._y=1005;
};
//je créé un champ de texte pour le titre de la page
cache_mc.createTextField('titre_txt',355,30, 30, 180, 30);
titre_txt.multiline=true;
var format_texte = new TextFormat;
format_texte.color =0xfffffff;
format_texte.font = 'verdana';
format_texte.size = 24;
cache_mc.titre_txt.text = 'Illustrations';
cache_mc.titre_txt.setTextFormat(format_texte);
//un petit graphisme pour faire plus joli[smilie23]
cache_mc.attachMovie('idsquare', 'square_mc', 104);
cache_mc.square_mc._x = 230;
cache_mc.square_mc._y = 48;
//et c'est parti pour le XML!!!
var ill_xml = new XML;
ill_xml.ignoreWhite = true;
ill_xml.onLoad = function (chargement){
if (chargement){
noeudRacine=this.firstChild;
ill_array = noeudRacine.childNodes;
for (i=0; i<=ill_array.length-1; i++){
box = cache_mc.createEmptyMovieClip('box'+i+'_mc', 10*i);
box.loadMovie(ill_array[i].attributes['chemin']);
var posy: Number=ill_array[i].attributes['y'];
box._x=150*i;
box._y=posy;
box.onRelease=function(){
//je teste mais il ne se passe rien.
trace('ok');
}
}
}
}
ill_xml.load('illustrations.xml'); |
voila j'espere que vous pourrez m'aider