Forum de discussion
Forum « Flash et Shockwave » (archives)
Re: Bouton radio dynamique (ActionScript)
Envoyé: 20 décembre 2003, 11h44 par maggy
La première partie sert à afficher les éléments qui se trouvent dans mon fichier .xml et la deuxième(éléments de gauche) cé pour afficher mes boutons radios
merci :)
for (var i = 0; i<c; i++) {
// elements de gauche------------------
this.attachMovie("enonce", "g"+i, i);
this["g"+i]._y = y;
this["g"+i]._x = x2;
// sert à afficher le texte de l'enoncé
this["g"+i].label.text = _global.monXML.objet.question[q].choix[t[i]].texte;
//sert à spécifier lequel est bon (la solution)
this["g"+i].trueFalse = _global.monXML.objet.question[q].choix[t[i]].bon;
this["g"+i].monY = y;
this["g"+i].ok = false;
this["g"+i].monNumero = i;
//--------------------------------------
this["g"+i].monNumeroCorrect = t[i];
//--------------------------------------
// elements de gauche-------------------
this.attachMovie("bouton", "f"+i, i+20);
this["f"+i]._y = y;
this["f"+i]._x = x;
// sert à afficher le texte de l'enoncé
this["f"+i].label.text = _global.monXML.objet.question[q].colonne[1].choix[t2[i]].texte;
//--------------------------------------
this["f"+i].maValeur = this["g"+i].vraiFaux;
//--------------------------------------
this["f"+i].pEtat = "actif";
this["f"+i].verificationCoche = false;
//--------------------------------------
this["f"+i].onPress = function() {
if (this.pEtat == "actif") {
this.gotoAndStop("false");
this.pEtat = "inactif";
this.verificationCoche = true;
trace(this.verificationCoche);
} else {
this.gotoAndStop("true");
this.pEtat = "actif";
this.verificationCoche = false;
trace(this.verificationCoche);
}
};
Réponses
|