473,324 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Only one Answer

Im pretty new to Flash And Ive gotton stuck on a quiz - so looking for help!!!

Ive got a quiz with 10 questions and each with a true or false MC next to them to be selected. At the end a check answer button calculates if the correct answers have been selected:

on (release) {
finalresult = result;
result += 0;
first1 = 1;
first2 = 1;
first3 = 1;
first4 = 1;
first5 = 1;
first6 = 1;
first7 = 1;
first8 = 1;
first9 = 1;
first10 = 1;
stop();
if (finalresult<6) {
comment6.text = "You only got "+finalresult+" correct.";
}else if ((finalresult>5) && (finalresult<11)){
comment6.text = "Well done you got "+finalresult+" correct.";
}else if (finalresult>10){
comment6.text = "To many hits, press the reset button!!";
}


BUT, What Im looking for; is there any way that some actionscript can be put on the true and false mc's so that once they have been hit once they cannot be counted again if the user accidentily hits the button again or changes there mind then hits back onto it?

Hope this makes sense - all advice would be REALLY appreciated!
Nov 19 '07 #1
3 1633
rsdev
149 100+
Im pretty new to Flash And Ive gotton stuck on a quiz - so looking for help!!!

Ive got a quiz with 10 questions and each with a true or false MC next to them to be selected. At the end a check answer button calculates if the correct answers have been selected:

on (release) {
finalresult = result;
result += 0;
first1 = 1;
first2 = 1;
first3 = 1;
first4 = 1;
first5 = 1;
first6 = 1;
first7 = 1;
first8 = 1;
first9 = 1;
first10 = 1;
stop();
if (finalresult<6) {
comment6.text = "You only got "+finalresult+" correct.";
}else if ((finalresult>5) && (finalresult<11)){
comment6.text = "Well done you got "+finalresult+" correct.";
}else if (finalresult>10){
comment6.text = "To many hits, press the reset button!!";
}


BUT, What Im looking for; is there any way that some actionscript can be put on the true and false mc's so that once they have been hit once they cannot be counted again if the user accidentily hits the button again or changes there mind then hits back onto it?

Hope this makes sense - all advice would be REALLY appreciated!
Attach a click counter to each mc.

Expand|Select|Wrap|Line Numbers
  1. on (release){
  2.  
  3. if(this.clicked==0){
  4. _root.first1 = true; // or button_name.first1 = true
  5. this.clicked++;
  6. }
  7. }
But I'm not sure how your finalresult and result variables work?! You keep adding 0 to the result (0+0=0)... Unless you mean the result is false?

I don't really understand!!

Read up in flash help about functions and your code would be neater by creating an onRelease function then you don't have to copy the code for each button.
Nov 19 '07 #2
Thanks Ill give that a go and see how I get on - Really appreciate it! Thanks again!!!
Nov 21 '07 #3
rsdev
149 100+
Hope it helps!!!

Let me know.
Nov 21 '07 #4

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

Similar topics

0
by: Arne Kösling | last post by:
Hi ! I am new to Web Services. Therefore I ve set up a PHP Installation on Windows (PHP 4.3.2 and Apache 1.3.29). I have tested PHP alone and then installed PEAR. Now I am stuck there (Before...
3
by: George Sakkis | last post by:
I'm trying to write a decorator similar to property, with the difference that it applies to the defining class (and its subclasses) instead of its instances. This would provide, among others, a way...
4
by: Bloon | last post by:
I have a question that how to debug a program only having .exe file. Is there any techniques or tools that can do that? Thanks a lot.
7
by: Privacy Advocate | last post by:
//crossposted to: comp.lang.javascript, alt.comp.lang.javascript in an effort to get factual answers from JavaScript experts// Simply put; Is it possible to obtain the real (actual) IP address of...
16
by: LP | last post by:
Hi, Every morning a .NET application downloads a file with cumulative data which needs to be appended to SQL Server table. This program needs to identify records that have not been previously...
4
by: Mrozu | last post by:
Hi I need function which can show me value of string only TO seted sign. For example i have string x="Hello, people" and i need function which show me string to ",", in this situation...
1
by: bobano | last post by:
Hi everyone, I am writing a POP3 Client program in Perl. You connect to a POP3 Server and have a running conversation with the mail server using commands from the RFC 1939 Post Office Protocol....
11
by: Theo Appelboer | last post by:
Is it possible to change the size of a Windows object (in this case a PictureBox) without calling MoveWindow? I'm writing a plugin for Winamp, in which I want to display a smooth bar that...
206
by: WaterWalk | last post by:
I've just read an article "Building Robust System" by Gerald Jay Sussman. The article is here: http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf In it there is a...
3
by: Puzzled and Confused | last post by:
It seems like a simple request, but I cannot get it to work. Does anyone know to how to make data from one field auto populate in another field, only if the answer is yes/true? I have a form that I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.