473,774 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Only one Answer

2 New Member
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 "+finalresu lt+" correct.";
}else if ((finalresult>5 ) && (finalresult<11 )){
comment6.text = "Well done you got "+finalresu lt+" 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 1641
rsdev
149 New Member
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 "+finalresu lt+" correct.";
}else if ((finalresult>5 ) && (finalresult<11 )){
comment6.text = "Well done you got "+finalresu lt+" 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
meechpee
2 New Member
Thanks Ill give that a go and see how I get on - Really appreciate it! Thanks again!!!
Nov 21 '07 #3
rsdev
149 New Member
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
4407
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 that, I had many problems with the PHP-dlls) I've set up several SOAP Testscripts that I found on WebSites and in PHP-Books to get a PHP Client and a PHP Server communicate over Web Services (using PEAR::SOAP).
3
2695
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 to define the equivalent of class-level constants: class Foo(object): @classproperty def TheAnswer(cls): return "The Answer according to %s is 42" % cls.__name__
4
2641
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
21317
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 someone (client) that visits a web site through an anonymous proxy if this person ONLY has JavaScript enabled in their browser? This is NOT a question about PHP, perl, VBScript, Java(.class), or ActiveX. Let us _only_ deal with JavaScript for...
16
1915
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 inserted (there's a unique identifier field) and only insert those. Also I must reuse our class that does updates, it basically can update any table by using SqlDataAdapter .update method. So I have to rule out bulk inserts, DTS, etc... I think I...
4
1378
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 Hello, other example
1
10067
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. This program can perform 5 options from a menu on your POP3 mail by logging in with the correct POP3 server along with a user name and password that you use to log in to your ISP. The user name and password as well as the server name are all hard-coded...
11
5582
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 displays a continuously changing output value. In this Winamp plugin I cannot use the SendMessage command because it causes lockups with Winamp. I _can_ use SendDlgItemMessage. The following code does the job:
206
8373
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 footprint which says: "Indeed, one often hears arguments against building exibility into an engineered sys- tem. For example, in the philosophy of the computer language Python it is claimed: \There should be one|and preferably only one|obvious...
3
2514
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 would like the exact data, which varies, to auto populate only after an update to yes. A toggle button is to answer the field, but I would like for the answer to be the data from another field. Please advise. Thanks!
0
9621
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
9454
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
10267
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
10106
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...
0
8939
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...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6717
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();...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.