Salut !!!
J'aimerais faire un questionnaire genre "test psycho", avec plusieurs questions et à la fin, le résultat des points, tout ça ...
J'ai mis les champs dans un clip. (un champ question, et 4 champs réponses à cocher...)
Le clip s'étend sur 50 frames. et 2 calques.
1er calque les champs... (le calques est long de 50 frames)
2e calque les 50 frames contenant toutes ceci :
pour la première :
myXML1 = new XML();myXML1.ignoreWhite = true;myXML1.load("questions.txt");
myXML1.onLoad = function(flag) {
if (flag) {
i = 0; x = myXML1.firstChild;
zeq.text = (x.childNodes[i].childNodes[0].attributes.value);
prop1.text = (x.childNodes[i].childNodes[1].attributes.value);
prop2.text = (x.childNodes[i].childNodes[2].attributes.value);
prop3.text = (x.childNodes[i].childNodes[3].attributes.value);
prop4.text = (x.childNodes[i].childNodes[4].attributes.value);
compteur.text = (x.childNodes[i].childNodes[5].attributes.value);
i++;}}
stop();
- pour la seconde :
myXML1 = new XML();myXML1.ignoreWhite = true;myXML1.load("questions.txt");
myXML1.onLoad = function(flag) {
if (flag) {
i = 0; x = myXML1.firstChild;
zeq.text = (x.childNodes[i].childNodes[6].attributes.value);
prop1.text = (x.childNodes[i].childNodes[7].attributes.value);
prop2.text = (x.childNodes[i].childNodes[8].attributes.value);
prop3.text = (x.childNodes[i].childNodes[9].attributes.value);
prop4.text = (x.childNodes[i].childNodes[10].attributes.value);
compteur.text = (x.childNodes[i].childNodes[11].attributes.value);
i++;}}
stop();
ainsi de suite... voilà ma question, comment faire pour qu'en cliquant sur le bouton suivant du questionnaire j'évite de retaper frame par frame les instructions de chargement... y'aurais pas un truc genre "++" à faire quelque part pour que les questions se chargent toutes seules...?!
et mon xml ressemble à ça :
<questionnaire>
<questions>
<qst value="quelle heure est-t'il?"/>
<qst value="je c pas"/>
<qst value="hein?"/>
<qst value="pkoi?"/>
<qst value="midi"/>
<qst value="1"/>
<qst value="Pourquoi?"/>
<qst value="bof"/>
<qst value="de koi?"/>
<qst value="hihihi"/>
<qst value="8)"/>
<qst value="2"/>
... etc, etc...
Merci de vos lumières...