473,659 Members | 2,656 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need some help - flash quiz

1 New Member
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:
http://www.flashkit.co m/movies/Applications/Multiple-sephirot-5192/index.php

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(_n ame,this); // remove other points
// making the coice
trace(_root.myC hoice);
if(_root.myChoi ce != undefined){
_root.Done = true;
_root.totalAnsw er++;
if(_root.myChoi ce){
giusta._visible = 1
_root.correctAn swer++
}
// displaing right & wrong answers
if(!_root.myCho ice){
errata._visible = 1
}
if(_root.totalA nswer == _root.toDisplay ){
_root.aspetta.i tsEnd = true
_root.aspetta.p lay();
} else {
_root.aspetta.p lay();
}
delete _root.myChoice;
}}
}
}
Nov 3 '07 #1
1 3086
rsdev
149 New Member
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:
http://www.flashkit.co m/movies/Applications/Multiple-sephirot-5192/index.php

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(_n ame,this); // remove other points
// making the coice
trace(_root.myC hoice);
if(_root.myChoi ce != undefined){
_root.Done = true;
_root.totalAnsw er++;
if(_root.myChoi ce){
giusta._visible = 1
_root.correctAn swer++
}
// displaing right & wrong answers
if(!_root.myCho ice){
errata._visible = 1
}
if(_root.totalA nswer == _root.toDisplay ){
_root.aspetta.i tsEnd = true
_root.aspetta.p lay();
} else {
_root.aspetta.p lay();
}
delete _root.myChoice;
}}
}
}
Hi Korr,

I would suggest using an listenerobject to check for a key press. Something like this.

var keyListener:Obj ect = new Object();
keyListener.onK eyDown = function() {
switch(Key.getC ode()){
case "80" : //key pressed is P
//do something when P is pressed
break;
}
};
Key.addListener (keyListener);
Nov 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1840
by: Carolyn Gill | last post by:
I have already created an asp login/database for a learning/quiz section on a small site. There will be multiple quizzes through the site and what I need now would be help: tutorials or advice that a complete novice can understand/follow to create the following: A small simple quiz--for now each has just one question with 5 multi-choice buttons. On submit should send the answer to A) a database (using access for now) to track scoring...
16
4185
by: C++ Hell | last post by:
Hey everyone just designing a quiz for school and managed to write the code for the questions and answers thou i have to add scores and at the end an overall score does anyone have any idea what to do or what i am talkin about
0
4573
NoPeasHear
by: NoPeasHear | last post by:
I don't know what I am doing wrong... I used this tutorial... http://www.permadi.com/tutorial/flashMXQuiz/index.html It works with their quiz.xml file, but when I add an option for multiple correct answers, the results page always gives me a response of 0. What would I change from the tutorial to have multiple correct responses reflect in the results? <?xml version="1.0"?>
3
3621
ZNip4
by: ZNip4 | last post by:
Hi this is my first time doing this so tell me if im doing anything wrong.... I just need help in creating the coding of this quiz im doing. I know so far how to load the data into the quiz by creating an array and using labels and text boxes (labels for the screen output and text boxes for data input). any help would be much appriciated.
1
1975
by: bikash607 | last post by:
Dear Expert, i m from very backward place in Bhutan and i need your assistance for a quiz program. I am trying to build a quiz program in Flash 6.0 and if you have any samples, please let me know....i will try my own but i didn't get any idea. Please help and I would remain thankful forever
5
2151
by: saytri | last post by:
Hi i have this project were i have to do a quiz. i wrote the questions in a textfile and i called them through java. I have also made a menu to choose which type of quiz. But before accessing the quiz i have to do a password and a login. I managed to do the password but when i tried to join this to the whole program its not working. This is the main program: import java.util.*; import java.io.*; import java.util.Scanner; import...
1
1906
by: saytri | last post by:
I have a problem with this code. I'm, doing a quiz, and the questions are stored in a binary file. My problem is how am i going to compare the answers entered by the user to the correct answers. The correct answers are stored in an array. Pls can someone help me with this code, because i'm really stuck. I think the problem is in the for loop (the code below). Thanks a lot. If you help me with examples of source code, i appreciate it a lot....
0
1744
nomad
by: nomad | last post by:
Hello Everyone: Would like to know if this is possible. I have a client that want me to create a quiz which would be created in Flash and the data would be in XML. I can do that part, but the next step I'm not to sure about. 1. How so I get the test results to db (DB would be in sql) 2. Can I use PHP and XML together. The PHP would be use to information like: Students name, status of on-line class taking, test results, certificate of...
1
2536
by: Holly Six | last post by:
I have a quiz file using the e-learning and quiz components. There is a bug for one condition - the user takes the quiz and fails, click the retake button and passes. The score that is written to the lms is the original failure. I have tried calling "QuizTrack.initStartQuiz()" on frame one as well as resenting all the scores - total_correct, total_wrong, and percent_correct. On the last frame I have tried adding into my regular fscommand entries...
0
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8332
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8525
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2750
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.