bonjour tout le monde
voilà mon problème pour que la chose soit plus imagé aller voir sur ce lien www.q-ba.fr/siaap/ en fait ce que je cherche à faire c'est de désactiver tout les boutons qui se trouvent à gauche pendant environ 2 sec lorsque j'ai cliquer sur l'un des boutons qui lance à chaque fois un zoom sur ma carte car si l'on clique tres vite sur tout les boutons l'animation pete les plombs y a t'il une bon âme qui voudrait bien m'aider voici le code que j'ai utiliser pour cette anim
// Masque moteur
_root.moteur._alpha = 0;
// Variable qui mémorise le picto on
var btn_clic = 0;
// Variable zoom
var zoom_clic = 0;
//Variable clip
var clip_clic = 0;
// Emplacement fond départ
var xStart = _root.fond._x;
var yStart = _root.fond._y;
// Function d'assignation du codes aux boutons
var maxBt = 17;
// Import Tween
import mx.transitions.Tween;
import mx.transitions.easing.*;
// Fonction d'écriture de la valeur dans la variable
function fixBtn(idBtn) {
// Réinit enabled + good img btn
if (btn_clic != 0) {
_root["bt_"+btn_clic].enabled = true;
_root["bt_"+btn_clic].gotoAndPlay(1);
}
// Fix sur img 2 du bouton en cours
btn_clic = idBtn;
// Code pour fixer le rollOver sur le bouton cliqué
_root.moteur.onEnterFrame = function() {
_root["bt_"+btn_clic].gotoAndPlay(2);
};
}
function fixClip(idBtn) {
// Réinit enabled + good img btn
if (clip_clic != 0) {
_root.fond["clip_"+clip_clic].enabled = true;
_root.fond["clip_"+clip_clic].gotoAndPlay(1);
}
// Fix sur img 2 du bouton en cours
clip_clic = idBtn;
// Code pour fixer le rollOver sur le bouton cliqué
_root.fond["clip_"+clip_clic].gotoAndPlay(2);
};
// Function zoom progressif
function animZoom(xPos, yPos) {
clearInterval(intervalZoom);
new Tween(fond, "_x", None.easeNone, fond._x, xPos, 20);
new Tween(fond, "_y", None.easeNone, fond._y, yPos, 20);
new Tween(fond, "_xscale", None.easeNone, fond._xscale, 150, 1, true);
new Tween(fond, "_yscale", None.easeNone, fond._yscale, 150, 1, true);
}
// Dezoom progressif
function animDezoom(xPos, yPos, valRetour) {
new Tween(fond, "_x", None.easeNone, fond._x, xStart, 20);
new Tween(fond, "_y", None.easeNone, fond._y, yStart, 20);
new Tween(fond, "_xscale", None.easeNone, fond._xscale, 64.75, 1, true);
new Tween(fond, "_yscale", None.easeNone, fond._yscale, 64.75, 1, true);
// on envoie l'anim
if (valrRetour != 1) {
//test retour
//trace("test retour");
intervalZoom = setInterval(animZoom, 1500, xPos, yPos);
}
}
// Affichage texte
function affichageTexte(idTxt) {
for (j=1; j<=maxBt; j++) {
if (j == idTxt) {
_root["txt_"+idTxt]._visible = true;
_root["txt_"+idTxt].gotoAndPlay(1);
} else {
_root["txt_"+j]._visible = false;
}
}
}
// Btn retour
_root.retour.onRelease = function() {
animDezoom(null,null,1);
affichageTexte(null);
// On arrête le moteur
delete _root.moteur.onEnterFrame;
// Clean interval
clearInterval(intervalZoom);
_root["bt_"+btn_clic].enabled = true;
_root["bt_"+btn_clic].gotoAndPlay(1);
_root.fond["clip_"+clip_clic].enabled = true;
_root.fond["clip_"+clip_clic].gotoAndPlay(1);
// Réinit var
btn_clic = 0;
zoom_clic = 0;
clip_clic = 0;
};
// Tableau des valeurs de zoom
// X array
xPosArray = new Array();
xPosArray[1] = "-250";
xPosArray[2] = "300";
xPosArray[3] = "400";
xPosArray[4] = "800";
xPosArray[5] = "900";
xPosArray[6] = "700";
xPosArray[7] = "550";
xPosArray[8] = "550";
xPosArray[9] = "350";
xPosArray[10] = "200";
xPosArray[11] = "-100";
xPosArray[12] = "350";
xPosArray[13] = "500";
xPosArray[14] = "200";
xPosArray[15] = "1000";
xPosArray[16] = "500";
xPosArray[17] = "650";
// Y array
yPosArray = new Array();
yPosArray[1] = "550";
yPosArray[2] = "700";
yPosArray[3] = "700";
yPosArray[4] = "650";
yPosArray[5] = "600";
yPosArray[6] = "500";
yPosArray[7] = "450";
yPosArray[8] = "300";
yPosArray[9] = "300";
yPosArray[10] = "250";
yPosArray[11] = "150";
yPosArray[12] = "150";
yPosArray[13] = "0";
yPosArray[14] = "0";
yPosArray[15] = "100";
yPosArray[16] = "0";
yPosArray[17] = "300";
// Creation function
function codeAssign() {
for (i=1; i<=maxBt; i++) {
// Masque calque texte
_root["txt_"+i]._visible = false;
// On stock le i dans le clip
_root["bt_"+i].num = i;
_root["bt_"+i].xArrive = xPosArray[i];
_root["bt_"+i].yArrive = yPosArray[i];
// Etat
_root["bt_"+i].onRollOver = function() {
this.gotoAndPlay(2);
//trace("on"+this.num);
};
_root["bt_"+i].onRollOut = function() {
this.gotoAndPlay(1);
//trace("off"+this.num);
};
_root["bt_"+i].onRelease = function() {
// On desactive le btn
this.enabled = false;
// On va record le num sel dans variable global
// On utilise pour cela la function fixBtn
fixBtn(this.num);
//pour l'anim du nuage
fixClip(this.num);
// On scale
if (_root.zoom_clic == 0) {
animZoom(this.xArrive,this.yArrive);
_root.zoom_clic = 1;
} else {
animDezoom(this.xArrive,this.yArrive);
}
// Affichage texte
affichageTexte(this.num);
};
}
}
// Lancement fonction
codeAssign();
//
stop();
Partager