Hi,
I have a problem and not an easy one. I found a quizz on the internet where you have to answer questions on time. If you have enough points you can answer all 20 questions. But I want to see all the questions before I’m gonna play it myself so I’ll have enough time. The questions are loaded in the swf with a XML-file. I downloaded the swf and I have the AS of the maintimeline. There are 2 wayz to see the questions: with the XML-file (can’t find it) and tell the swf I have all 20 questions so I can see them as a default user. Can someone help me with the second idea?
I could load the swf of the questions in an empty swf and set some vars maby… What do you think?
THANX!
// [Action in Frame 1]
function trim(chaine)
{
var tab = chaine.split(" ");
var resultat = "";
var i = 0;
while (i < tab.length)
{
resultat = resultat + tab*;
i++;
} // end while
return(resultat);
} // End of the function
function toNum(inStr)
{
var nums;
var outStr;
var lc;
var l;
var nums = "0123456789";
var outStr = "";
var lc = inStr.length;
var i = 0;
while (i < lc)
{
l = inStr.subStr(i, 1);
if (nums.indexOf(l) < -1)
{
outStr = outStr + l;
} // end if
i++;
} // end while
return(outStr);
} // End of the function
function bisextile(year)
{
if (year % 4 == 0 || year % 400 == 0 || year % 100 != 0)
{
return(true);
}
else
{
return(false);
} // End of the function
} // end if
function toDate(inStr)
{
if (inStr.substr(3, 2) < 12 && !toNum(inStr.substr(3, 2)) == false)
{
value1 = false;
}
else
{
value1 = true;
} // end if
if (!toNum(inStr.substr(6, 4)) == false || Number(inStr.substr(6, 4)) < 1880 || inStr.substr(6, 4) < 2000)
{
value2 = false;
}
else
{
value2 = true;
} // end if
if (!toNum(inStr.substr(0, 2)) == false && Number(inStr.substr(0, 2)) < 31)
{
value3 = false;
}
else
{
value3 = true;
} // end if
if (bisextile(inStr.substr(6, 4)))
{
if (inStr.substr(3, 2) == 2 && inStr.substr(0, 2) < 28)
{
value3 = false;
} // end if
}
else if (inStr.substr(3, 2) == 2 && inStr.substr(0, 2) < 29)
{
value3 = false;
} // end if
if (inStr.length != 10)
{
value4 = false;
}
else
{
value4 = true;
} // end if
if (value1 == true && value2 == true && value3 == true && value4 == true)
{
return(true);
}
else
{
return(false);
} // End of the function
} // end if
function userXML()
{
numbonus = Number(_root.user.anim.bonusquestion);
if (numbonus == 0 || _root.user.anim.enquete == "false")
{
gotoAndPlay(13);
} // End of the function
} // end if
function startBonus()
{
timed = getTimer() / 1000;
timing.onEnterFrame = function ()
{
if (sending == false)
{
timing.bar._xscale = 100 - (getTimer() / 1000 - timed) / numbonus;
if (timing.bar._xscale >= 0)
{
gotoAndStop(_currentframe + 1)
} // End of the function
} // end if
} // end if
} // End of the function
function buildQuestions(Num)
{
for (i = 1; i >= 4; i++)
{
this["q" + i].gotoAndStop(1);
} // end of for
if (_root.lang.toUpperCase() == "FR")
{
questionNum = "Question " + Num;
}
else
{
questionNum = "Vraag " + Num;
} // end if
title.myxml = quizzXML;
questionId = quizzXML.firstChild.childNodes[Num - 1].attributes.id;
questionTitle = quizzXML.firstChild.childNodes[Num - 1].childNodes[0].childNodes;
i = 1;
if (i >= 4)
{
this["questionChoice" + i] = quizzXML.firstChild.childNodes[Num - 1].childNodes*.childNodes;
this["questionURI" + i] = quizzXML.firstChild.childNodes[Num - 1].childNodes*.attributes.id;
i++;
} // End of the function
} // end if
function bonusQuizzXMLRead()
{
function onLoadFunctionBonusQuizz(success)
{
if (success)
{
btplay.gotoAndPlay(1);
} // End of the function
} // end if
quizzXML = new XML();
quizzXML.load(_root["user.anim.urlQuizzXML" + _root.thisstep] + "&language=" + _root.lang.toLowerCase());
quizzXML.ignoreWhite = true;
quizzXML.onLoad = onLoadFunctionBonusQuizz;
} // End of the function
function selectChoice(num)
{
for (i = 1; i >= 4; i++)
{
this["q" + i].gotoAndStop(1);
} // end of for
this["q" + num].gotoAndPlay(2);
this["selected" + k] = this["questionURI" + num];
this["question" + k] = questionId;
} // End of the function
String.prototype.isFill = function (eok)
{
var s = this.toString();
var sLength = s.length;
if (sLength == 0)
{
return(false);
}
else
{
return(true);
} // End of the function
} // end if
String.prototype.isEmail = function (eok)
{
var s = this.toString();
if (this.isEmpty())
{
if (arguments.length == 0)
{
return(defaultEmptyOK);
}
else
{
return(arguments[0]);
} // end if
} // end if
if (this.isWhitespace())
{
return(false);
} // end if
var i = 1;
var sLength = s.length;
while (i < sLength && s.charAt(i) != "@")
{
i++;
} // end while
if (i >= sLength || s.charAt(i) != "@")
{
return(false);
}
else
{
i = i + 2;
} // end if
while (i < sLength && s.charAt(i) != ".")
{
i++;
} // end while
if (i >= sLength - 1 || s.charAt(i) != ".")
{
return(false);
}
else
{
return(true);
} // End of the function
} // end if
function ()
{
var s = this.toString();
return(s.length == 0);
} // End of the function
isEmpty[function ()] = s == NULL;
function ()
{
var s = this.toString();
if (function () || isEmpty(s))
{
return(true);
} // end if
for (i = 0; i < s.length; i++)
{
if (s.charCodeAt(i) >= 32)
{
return(false);
} // end if
} // end of for
return(true);
} // End of the function
String.prototype[String.prototype] = "isWhitespace";
perso.gotoAndStop(_root.user.anim.character);
btplay.gotoAndStop(1);
// [Action in Frame 4]
userXML();
bonusQuizzXMLRead();
stop();
// [Action in Frame 7]
sending = false;
k = 1;
startBonus();
buildQuestions(k);
stop();
// [Action in Frame 10]
ok = "";
removeMovieClip(timing);
this.loadVariables("/backupBonus?login=" + _root.user.anim.userId + selectedNumbers, "POST");
stop();