Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

flash quiz help

Status
Not open for further replies.

porcupinetree

Technical User
Nov 3, 2007
1
GR
Hi there,
i'm trying to develop a quiz in flash.
Searching on the net, I found a quiz in flashkit from sephiroth.it by Alessandro Crugnola.
His quiz has a script that puts the questions and the answers in random order.
What i'm looking for is to not select the answers by clicking the mouse, but using the keyPress handler.
Using the keyPress handler the script selects only the first answer
I tried a lot but i didn't find any solution..
2 hours ago, I thought that I found a solution using if(this._name=="answer1") but it works only with the "on(release)" handler, when I replace it with the on(keyPress) the script selects again only the first answer...
Any help would be much appreciated...

this is the link where you could d/l the quiz:

and below is the btn source.

Thank you in advance.



on(release){
if(this._name=="answer1")
{
if(!_root.Done){
point._visible = 1
_root.myChoice = thisChoice; // choice
removePoints(_name,this); // remove other points
// making the coice
trace(_root.myChoice);
if(_root.myChoice != undefined){
_root.Done = true;
_root.totalAnswer++;
if(_root.myChoice){
giusta._visible = 1
_root.correctAnswer++
}
// displaing right & wrong answers
if(!_root.myChoice){
errata._visible = 1
}
if(_root.totalAnswer == _root.toDisplay){
_root.aspetta.itsEnd = true
_root.aspetta.play();
} else {
_root.aspetta.play();
}
delete _root.myChoice;
}}
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top