Multiple Answers
I'm trying to build a Mutilple choice quiz with single and multiple answers without using the interactions. The problem that I'm having is putting the multiple answers into an Incrementing text field. Thanks for any help
FlashKit > Flash Help > Flash Newbies
Posted on: 07-17-2002, 01:25 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Multiple Answers?
Hey,
Just wondering if anyone could help me with a little quiz issue. I'm trying to make a multiple choice quiz that has multiple answers ... there are 4 questions and 3 ways of answering:
1. you click on all the right answers and go to the CORRECT frame or
2. you click on 1 or more right answers and go to the ALMOST CORRECT frame and
3. get none of the right answers and go to the WRONG frame
Thanks,
Kev.
Multiple Input Answers
How do I add multiple answers to 1 input box?
Here is my code:
Quote:
on (release) {
if (ARCID == "ZSVPD"
&& NUMBER == ""
&& ADEP == "FALA"
ADEP Being the Variable and/or object name. FALA being the Answer
&& ADES == "FAKM"
&& SPEED1 == "N"
&& SPEED2 == "0200"
&& REG == ""
&& ARCTYP1 == "BE26"
&& ARCTYP2 == "L"
&& EOBT == "0840"
&& TTLEET == "0210"
&& RFL1 == "F"
&& RFL2 == "200"
&& FLTRUL1 == "I"
&& FLTRUL2 == "G"
&& EQPT1 == "SJ"
&& EQPT2 == "C"
&& ALTRNT1 == "FABL"
&& ALTRNT2 == "FAUP"
&& ROUTE == "JSV G765 BLV K980F"
&& OTHERA == "SAR/En-Route"
&& OTHERB == "EET/FABL0040"
&& OTHERC == "OPR/Blue Aviation Lanseria"
&& ENDURANCE == "0040"
&& POB == "004"
&& DINGHIESNO == "02"
&& DINGHIESCAP == "004"
&& DINGHIESCOVER == "Orange"
&& ACFT == "White and Blue"
&& PIC == "William Blue"
&& PILOT == ""
&& INFO == ""
&& REMARKS == "First Aid Kit (or FAK) and Water"
&& REMARKSPHONE == "(011)6754321"
&& _global.SurvPolar == false
&& _global.varUHF == false
&& _global.varVHF == true
&& _global.varELT == false
&& _global.varF19 == false
&& _global.varDesert == false
&& _global.varMaritime == true
&& _global.varJungle == true
&& _global.varJackets == false
&& _global.varLight == false
&& _global.varFluores == true
&& _global.varUHF2 == false
&& _global.varVHF2 == true
&& _global.varCover == true
&& _global.varPhone == false
) {
gotoAndPlay("correct");
} else
gotoAndPlay("retry");
}
Multiple Answers Accepted
Hi there helpful people,
just a quickie.
If I have some input text that will allow multiple answers (say two answers, ie "a" or "b"), how do I go about that?
I've tried the code below to no avail and any help would be appreciated:
Attach Code
var input3answer = ("a") || ("b");
trace (input3answer);
onCheck.onPress = function() {
var Answer:Number = 0;
if (input3.text == input3answer)
Answer = 1;
if (Answer == 1) {
gotoAndStop("input4");
} else {
gotoAndStop("input3");
}
};
Quiz With Multiple Correct Answers?
I'm developing a quiz, and I need to have a question with four answers (A, B, C, & D).
Choice D (all of the above) is the correct answer; However, I'd like to set this up so that the user can also check A, B, and C and still be counted as giving the right answer.
Note that they can't just say A or B or C, the only two possible correct combinations are:
D
or...
A B C
Is there any way to do this?
Thanks!!!
How To Randomize Answers In Multiple Choice Quiz?
Hi, I'm trying to create a multiple choice quiz with Flash MX and XML.
I have the quiz itself working, but I would like the answers to be random so that they are not always in the same order. How can I do this?
Also how can I make it so that if I have for example 10 questions in my XML file, the quiz would ask 5 of them in random order?
My .fla and .xml are attached.
Any help is appreciated.
Is It Possible- Multiple Choice Quiz W/ Answers AFTER Each Question
Hi All,
Can someone shed some light on this for me? I know how to make a multiple choice quiz w/ the questions, then a score at the end. But what I want to do is give the answer after each question and a small paragraph basically giving more info as to why that answer is correct. I can't seem to do this and my reference book I have for FLASH doesn't really deal with the issue.
Is it even possible?
auntmillyto3
Multiple Answers To 1 Question In Flash Quiz?
I have followed Colin Moock's example of the multiple choice quiz (array method). But instead of having only one answer per question, I need to allow the user to have the choice of 2 or even three possible answers to one question. How would i do this?
var correctAnswers = [3,1];
numQuestions = correctAnswers.length;
this is obviously only working properly if there are three questions. I want one question but three anwers..
here's my buttons code:
ActionScript Code:
tick1.onRelease = function(choice) {
if (tick1.tickBox._currentFrame == 2) {
answer(1);
} else if (tick1.tickBox._currentFrame == 1) {
userAnswer.pop();
}
}
Counting Wrong Multiple Choice Answers
Hi
I made a flash movie with a small quiz.
Now I want to show the user at the end of the quiz, how many times he/she gave a wrong answer.
(after each question they answer they already get feedback wether the question was right or wrong and why)
so I thought to make a new layer with this code:
var totalWrong = 0;
and then on each 'wrong' button: totalWrong++;
and at the end a dynamic textbox with this code on it's keyframe:
totaltext.text = "You gave " + totalWrong + " times a wrong answer";
Problem is it doesn't work, and I have no idea what I'm doing wrong.
Any help is much appreciated! :)
-----
I'm unique, just like everyone else...
Quiz Template> Checkboxes> Multiple Correct Answers
Could someone please point out where in the Flash 8 Quiz Template Multiple Choice Actionscript logic, the correct feedback is set only if ALL of the correct answers are selected?
We would like to consider cases where checkbox1 OR checkbox2 is a correct response rather than require checkbox1 AND checkbox2 to be checked for a correct feedback
I Need To Create A Random Answer Generator With Multiple Line Answers? Any Ideas?
Can anyone help me??? I need to create a random answer generator that when a button is pressed will produce an answer!!! My only problem is the answers will be 5 lines long and I don't know how to do this!!! I can do it with one line but am not sure where to start with 5??? Here is the script that I am using at the mo...
on(release){
ran=math.round(math.random()*10+1);
myTextfield=eval("a"+ran);
}
Cheers!!!
Need Answers.
Hey can anyone tell me how to make a website fullscreen like at http://www.tombraidermovie.com ?
I Need Answers...
well i got this .swf file and i need to know what the action script is for the boxes i have it uploaded onto my backup server http://odin.elixant.com/aqhack.swf i heard it uses actionscript 6.0 and i need to knopw the action script for the boxes so i can make it not work anymore its a BATTLE SIMULATOR SOM,EONE MADE FOR MY AGEM I NEED TO DISABLE IT.
Need Some Answers...
I downloaded the Flash MX 2004 30-Day Trial from macromedia.
I have about 8 or 9 days left on my trial period.
When this Trial Period ends, will it work if I download it
again and re-install it?
A Few Qns That Need Answers
1) for an input text area is there any way to count the number of lines that was entered?
2) for something like a password box i want the characters to be * instead.. how can i do that?
thanks
Need Some Answers...
I downloaded the Flash MX 2004 30-Day Trial from macromedia.
I have about 8 or 9 days left on my trial period.
When this Trial Period ends, will it work if I download it
again and re-install it?
I Already Did A Search, Need Answers
I demand answers dammit. Okay, anyway, lemme start <lamer mode> here. How can I convert swf's to wallpapers? I did a search round the net for a good twenty minutes and was able to find dozens of .swf --> screen saver progs out there, but nothin for wallpapers. </lamer mode>
Other more tech-geeky question: Why couldn't I just publish a flash movie to win projector, i.e .exe file. Then change extension to .scr (screen saver aka EXE) and throw it in my windows/system directory. When i do the properties/screen savers trick, it lists my file, but it won't let me use it. Any ideas oh wise flashing gurus?
-darque9
Who Answers My Questions?
Questions are simple - I have 3 Flash movies (1.fla, 2.fla and 3.fla). Want to make a button that after clicking on it, I will go from 1.fla to 2.fla and from 2.fla to 3.fla (or their respective swf files). What's the script for the button(s)?
Do I have to have a separate layer for actions?
I was trying to put action script but all options in AS palette are grayed out. In another MC I was able to put script on a button when I didn't have any layer for my script. I am a bit confused about everything and am not advanced Flash player. Please forward your help to elzep@excite.com. Thank you very much!
Answers To FAMXQS
Hi,
somebody suggested to start a site to easily find answers for frequently asked MX questions. I will start it with the first thread. So please join me and add only threads where the discussion seemed fruitful.
Loading dynamic text, MX won't recognize special chars??
http://board.flashkit.com/board/show...hreadid=325194
Some Useful Questions Need Answers....
Hello guys....long time to visit the site....
Anyway,
I wonder what's most useful to make a flash site like this: 4 scenes (intro preloader, intro, main preloader, main) ?
Or seperate 2 .swf with each Intro and Main will have their preloaders?
Finally I would love to have code or a sample/tutorial for a preloader with interactive bar with filesize details in kbytes and % percent.
For samples or tutorials please if you have the time send me e-mails at vag@vagdesign.com
Thanks alot my friends
Have a great day.
VAG
2 Questions, Hopefully, 2 Answers :)
I posted this first one already but didn't get what I was looking for.
Hopefully better luck this time
1-- I need to set up a preloader to load the first 12kb and then start playing, rather than say, loading up to frame 200. Could someone help me out with how to set this up? Just one scene, very simple movie. Just need it to load that first 12kb before playing.
2-- Probably already on here somewhere but...
How do I get a movie to be centered on a webpage, not matter the screen res. or window size? Think it's a basic html code, but can't seem to find it anywhere. ie: www.oddcast.com
Any help would be greatly appreciated.
Richard
Searching For Answers
Here's what I've been trying to create: Flash detector with that will load a flash movie in a new pop-up window, height 800px by width 600px, no borders, scrollbars, just the movie itself. After the flash starts loading, the detector window closes itself.
The first html, for the detector, the html/js looks like this: www.penque.com/test7/moockfpi.txt
The second is the flash movie:
www.penque.com/test7/index1.txt
I've set the moockfpi's var useRedirect to true, but it's still playing in the loading the movie in the same window, not a new pop-up. I suspect there's something missing from index1
Here's the result I'm getting so far:
www.penque.com
What do I need to change? Any solution would be greatly appreciated.
Quite A Few Questions. I REALLY Need The Answers...
... Mmm... Doughnut... Hmm-wha'-wha'? Oh! Right! The question... I was wondering if anyone knew how to keep a connection going between a Flash MX movie and a MySQL database. Also, how would I be able to use that connection to send/retrieve text and images into a scrolling part of the movie? I'm trying to put together a full-featured BBS in Flash MX. I'm hoping that it'll be able to instantly update every time new data is retrieved. (After all, I would think that Flash (As specially Flash MX) would have that kind of flexibiblity and power.) And, last but not least, does anyone know how to have a scene randomly generated with the data from a MySQL database but use a pre-defined animation?
Thanks for your info!
Lybib
P.S.
Please try to make it as simple as possible. I'm pretty, darn new at this. Oh, and could you post a quick quide as to how to do the above things if you know how to? I'm sure there're others who could use that info.
On A Quest For Answers....
Hi there,
I have two questions that I would like to guys to consider giving me an answer for. They are fairly simple so here goes...
1. Is there a tutorial somewhere that teaches correct motion tweening techniques, and all the things to consider, or should these types of animations rather be made actionscript, for better control?
2. If i create a function in actionscript which would have some code in it to move movieclips, duplicate them, and do a whole range of other stuff, can i call this function on a onClipEvent(Load) command, and how would I address the individual properties of that movie clip from within that function?
2a. if i use for example "this._x" in the function, would the MC know that my actionscript is reffering to it, or would I need to assign variables from my function to the individual properties of the MC. The reason I am asking, is that I want to avoid copying and pasting actionscript into diffrent MC's and then If I need to change something I have to change it in all the MC's instead of just the function?
Two Questions...looking For Answers
I have been updateing my loading screen for my movies and I've decided to add a bytes loaded section. It seems to work fine but I need to format it. There is no need for XX.XXXXXX loaded. Anyone know a way to format this so its only XX.X? Also, I'm working on trying to optimize a movie (for lower file size) however every modification that I make (reducing pixles, size, quality, ect) just makes the file larger. What can I do to get my file size down? Any suggestions are helpful.
Sparkyfire
Questions And Answers
I am setting up a math tutorial for my students and I need some help. I want to set up a question and then have the students answer the question and be able to check if they are correct. If they are correct I want the movie to continue and if they are wrong then I want them to go back to the question and try again.
Here is the question
What is the ratio of snowmen to carrots
answer 5 to 3
Thanks
Glenn
Questions.Don't Know Answers
I'm pretty new to actionscript, but I'm trying something a little more mad than my usual stop(), play().
I've managed to build a game where you dress a person. I've done it in drag and drop so when the Var names, ie you put the right Item of clothing over the right area match up it plays a movie.
What I wanna do is when all four items of clothing are on the doll play a congradulations movie, but I'm stuck as of how to do it.
I think I need to apply a value of 1 in each movie clip and when all four movies equal 1 play the congradulations movie but I'm stuck!!
Any help would be massively appreciated. I've been stuck for ages, I'd love to finish this movie!
Answers For Php And Mysql
just thought i would share this nifty way of checking to see if your php is communicating with mysql.
if so, then check this link out, life may be much easier:
http://www.flashkit.com/board/showth...hreadid=621041
create a file called helloworld.php and put it inside webroot or htdocs for me cuz i use http://www.apachefriends.org . in this file copy and past the code below.
open your browser and point it to http://localhost/helloworld.php and see what you get.
Code:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php // ***** this code outputs hello world *****
echo '<p>Hello World</p>';
?>
<?php // ***** this line tells you what browser your using *****
echo $_SERVER['HTTP_USER_AGENT'];
echo '<p></p>';
?>
<?php // ***** this line checks to see your using IE, if so then it tells you *****
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE)
{
echo 'You are using Internet Explorer.<br />';
echo '<p></p>';
}
?>
<?php // ***** this code connects to mysql, if successfull then it tells me *****
// ***** this code connects to a database, if successfull then it tells me *****
// ***** this code outputs the query in html format *****
// Connecting, selecting database
$link = mysql_connect('localhost', 'root', 'sweet')
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
echo '<p></p>';
mysql_select_db('amfphpexample') or die('Could not select database');
// Performing SQL query
$query = 'SELECT * FROM users';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
// Printing results in HTML
echo "<table>
";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo " <tr>
";
foreach ($line as $col_value)
{
echo " <td>$col_value</td>
";
}
echo " </tr>
";
}
echo "</table>
";
// Free resultset
mysql_free_result($result);
// Closing connection
mysql_close($link);
?>
<?php // this code just tells you the ENTIRE information of php *****
phpinfo();
?>
</body>
</html>
if you need to fix your password for mysql, then here you go as well:
Code:
At the DOS command prompt, execute this command:
C:> C:mysqlinmysqld-nt --skip-grant-tables
This starts the server in a special mode that does not check the grant tables to control access.
#
Keeping the first console window open, open a second console window and execute the following commands (type each on a single line):
C:> C:mysqlinmysqladmin -u root flush-privileges password "newpwd"
C:> C:mysqlinmysqladmin -u root -p shutdown
Replace ``newpwd'' with the actual root password that you want to use. The second command prompts you to enter the new password for access. Enter the password that you assigned in the first command.
and a simple note:
Code:
shell> mysql -ptest
shell> mysql -p test
The first command instructs mysql to use a password value of test, but specifies no default database. The second instructs mysql to prompt for the password value and to use test as the default database.
hope this saved you alot of time...
Hector
Need Answers Urgent..
(btw, im a newbie)
how do i make objects disappear when the mouse is over a (any) button? not permanantly, but disappear while the mouse hovers over a button.
Required Answers ...
Hi
I'm new to this flash so i had some questions, could you help me for answers ?
1. What is the difference between Flash Basic & Flash Professional
eg: Flash MX-2004 and Flash MX-2004 Professional
2. Whats new in Flash 8 ?
3. Diff: Flash Mx-2004 & Flash 8
4. I want to know more about video options in Flash MX-2004 & Flash 8
5. What is the latest versions of
- Action Scripting
- Flash Player
Plz respond.
Thnks
Still Hoping For Answers
I'm still trying to find somebody in this forum who can help me with what has to be a simple problem, but one I can't seem to sort out.
I'm trying to make a button that, in its Up state, fades in from 0% alpha to 100%, and then holds that 100% forever more (unless the site is refreshed)
What I have now is a button that fades in, but then when you roll off, it goes back to 0% and fades in again when you roll back on.
The whole story is found at the link below, and the very last post contains a zipped file which demonstrates the problem.
http://flashkit.com/board/showthread.php?t=663783
If anyone here knows anything about how to solve this problem, please send me a PM through this forum or reply to the thread outright.
Thanks and Happy New Year!
Buttons And Answers
Hi.I'm developing a program that put a movie clip at random spots on the stage.I've got that part done.What happens is a user pushes a button and gets a random placing all good there.What i can't figure is how to record his answer on the button he pushed.
Here's my code:
var S1 = [cionbe._x= 135.5,cionbe._x=155.0,cionbe._x=150.0,cionbe._y=17 7.5];
mybuttons = [btn1,btn2,btn3,btn4,etc.....];
for(i in mybuttons){
mybuttons[i].onRelease = moveEm;
}
function moveEm ()
{
moveEm = Math.random()*550;
cionbe._x = moveEm
}
So say i have btn1 and want it to be for the._x=155.0,and btn2 for the._x=150.0,and etc.I've tried many times with functions of all sort and
tried set/get property to no avial.After i figure this out i can put my score keeping system into place fairly easy I think.Any help is greatly appreciated.
O.k. here is my updated code for many struggling hours.
var moveMC = [cionbe._x= 135.5,cionbe._x=155.0,cionbe._x=150.0,cionbe._y=17 7.5];
mybuttons = [btn1,btn2];
for(i in mybuttons){
mybuttons[i].onRelease = moveEm;
}
function moveEm ()
{
moveEm = Math.random()*550;
cionbe._x = moveEm
}
var answerE = [_x=135.5,_y=177.5];
var answerfS=[_x=155.0,_y=177.5];
if (btn1.onPress == answerE){
trace ("correct");
}
Quiz Like Answers
Hi there i was just wondering how in a quiz u would define 'like' answers such as an answer that is '7' but that means that the answer is also be 'seven'.
eg.
_root.variable = random(int(3))+1
if(_root.variable == 3){
question.text = "How many days in a week?"
_root.correct = "7";
}
how would i write the alternaitive answer??
Questions And Answers
i need to use a xml file that contains a list of questions and answers.
The questions must appear in a scoll box list on the left and when clicked on updates a scroll text box on the right
I think i can use the flash components but i am unsure as how to do this can anyone help please.
I have enclosed a sample of the xml file.
[F8] Array For Answers
This is for my FAQ's section of my web based training course. There are five questions, when the user clicks on the question the answers is displayed and a value is added to my array. I am trying to check if the user has click on all 5 questions before then you can continue. My problem is this, if the user clicks on the last question at anytime it allows them to continue.
Here is my code
Code:
var atotalAnswered:Array = [];
trace(atotalAnswered.toString());
function chkArrayLength(){
if(atotalAnswered.length == 5){
fscommand("LMSSetValue", "cmi.core.lesson_status,completed");
getURL("../../trainingcompletion1.htm","_blank");
trace("complete");
}else{
trace("incomplete");
}//end if
};
question1_btn.onPress = function(){
question1_mc.gotoAndStop(2);
atotalAnswered[0] = "question1answered";
chkArrayLength();
caption_mc.gotoAndStop("question1");
}
question2_btn.onPress = function(){
question2_mc.gotoAndStop(2);
atotalAnswered[1] = "question2answered";
chkArrayLength();
caption_mc.gotoAndStop("question2");
}
question3_btn.onPress = function(){
question3_mc.gotoAndStop(2);
atotalAnswered[2] = "question3answered";
chkArrayLength();
caption_mc.gotoAndStop("question3");
}
question4_btn.onPress = function(){
question4_mc.gotoAndStop(2);
atotalAnswered[3] = "question4answered";
chkArrayLength();
caption_mc.gotoAndStop("question4");
}
question5_btn.onPress = function(){
question5_mc.gotoAndStop(2);
atotalAnswered[4] = "question5answered";
chkArrayLength();
caption_mc.gotoAndStop("question5");
}
AS Questions- Really Need Answers...
Question 1:
Alright, there's a movie clip with the instance name "wierdmonster", with the AS:
Code:
onClipEvent (enterFrame) { if (_root.player._x > _x) { _x += 2; }}onClipEvent (enterFrame) { if (_root.player._x<_x) { _x -= 2; }}onClipEvent (enterFrame) { if (_root.player._y>_y) { _y += 2; }}onClipEvent (enterFrame) { if (_root.player._y<_y) { _y -= 2; }}
and in this movie clip, there's another movie clip with the instance "wheel"
now, on every frame, the instance "wheel" has the AS:
Code:
onClipEvent (enterFrame) {
if(_root.wheel.hitTest(_root.player)) {
_root.wierdmonster.gotoAndPlay ("damage")
}
}
Now, I have the labels:
stand, move, damage, death.
on every fame in "move" it has:
Code:
if (damage == 3){
gotoAndPlay ("death")
}
On the frame before "damage" it has the AS:
Code:
gotoAndPlay("stand");
And on the frame "damage", it has:
damage += 1;
And on the rest of the frames in "damage", it has:
Code:
if (damage == 3){
gotoAndPlay ("death")
}
On the frame before "death", I put:
Code:
gotoAndPlay ("stand")
And on the final frame in "death", I put in:
Code:
stop ();
And it's not working. Please help me out, thanks.
Question 2:
Code:
if (Key.isDown(38)) {
if (grounded) {
yspeed = -jump;
if(player._currentframe==2){
_root.player.gotoAndStop (5)
} else {
_root.player.gotoAndStop (6)
}
Alright, instead of what I want, it just goes to frame 6 every time. Please help.
Two Different Math.sin() Answers.
Hello all.
I'm once again trying to wrap my head around basic trig and have found something that--to me--seems odd. This post could probably go in another forum, but since I'm using CS3 this is where I'm posting it.
I've started by trying to get a handle on Math.sin(). Believe it or not, I do understand it, I think. But I've found what seems to be an anamoly.
I'm doing my simple tests by just typing code in a keyframe of the timeline.
When I enter:
trace(Math.sin(30 * Math.PI/180));I get an answer of 0.49999999999999994 which is expect.
When I enter:
x = Math.sin(30 * Math.PI/180);trace(x);I get an answer of .45 which seems way off even for basic rounding.
So why is there two very different answers?
Thanks,
----Damian
From EXE To Flash. Need Answers Plz.
Currently I have a game that is in 3D using OpenGL. I'm exploring the idea of posting this on the web, and so far the only Avenues that are open to me are Flash and ActiveX. I have been down the ActiveX route and its ugly. So I'm asking you guys for some help.
My Project:
- It is a 3D game which uses a physics engine to do collisions and movements. I have looked up a Physics library for flash that does exactly what I need called APE (Actionscript Physics Engine).
- For the 3D drawing capabilities, I can use PaperVision's 3D rendering library to render all of my 3D geometry. I have seen that it can draw 3D fairly well for what I'm hoping to use it for.
- Also, I'm looking into using Flex as the builder and for the availability of widgets for on-screen interaction.
My Questions:
- Is it possible to do what im asking?
- Is Flex really necessary for widgets or should I just use something else?
- Can AS3 accommodate the types of features a 3D based game has, such as realtime keyboard event capturing, Fast rendering, read/write form hard drive, SOAP/XML parsing?
- Lastly, can all this be done using nothing but AS3 and without creating any sort of visual design using the Flash studio??
Any answers/suggestions/comments are more then welcome. I greatly appreciate the help.
Flashcards: How To Get Answers
Hi, This is my third post on this topic. In it, I've tried to clarify what I am trying to do:
I'm new to ActionScript. As a first step to learning how to program to ActionScript 2, I wanted to develop a study tool in Flash, one that requires a knowledge of ActionScript 2. Sounds like a catch 22, doesn't it?
A very useful study tool is a set of flashcards (the term "flash" used here has nothing to do with Macromedia Flash.) The idea is to randomly shuffle the cards, then look at the piece of info on one side of a card, try to answer it, and then flip over the card to see if you got the answer correct. Each time you study the cards is a different sequence.
Below is the ActionScript 2 code I have so far, courtesy of Kenneth Kawamoto:
// ActionScript 2
var frames:Array = [];
for (var i = 2; i<=31; i++) {
frames.push(i);
}
// Frame 1 says "Start."
// Frames 2 through 31 are the flashcards.
// Frame 2 is Flashcard 1, Frame 3 Flashcard 2, etc.
// Change i<=n to whatever the last flashcard frame nr. is.
// The last frame (#32) says "Finished."
stop();
//
this.button.onPress = function() {
var frameNumber:Number;
var n:Number = this._parent.frames.length;
if (n) {
var randomIndex:Number = Math.floor(Math.random()*n);
frameNumber = this._parent.frames.splice(randomIndex, 1);
} else {
frameNumber = 32;
//The nr. above is last the frame, titled "Finished."
}
this._parent.gotoAndStop(frameNumber);
};
//
When the Flash .swf file is activiated, you begin with a flashcard that says "Start." Then, each time you press the shuffle button (named "button" in the script), one of the 30 (in this example) flashcards is randomly shown. Each time you press the shuffle button, you are randomly sent to a different flashcard. When all 30 flashcards have been shown, on the next button press you get a card that says "Finished."
So far, so good. Now, I would like to have an "answer button" on each flashcard that has a different function than the shuffle button mentioned above. When you press that button, you would be sent to a frame that has the answer for that flashcard. For example, If the flashcard says, "Who developed Flash?," you'd press the answer button, which sends you to a frame with the answer "Macromedia."
Then, ideally the answer frame would have a "return button" on it which when pressed would send you back to the question card. And then you would press the shuffle button to move on to the next flashcard question, after which you repeat the sequence until all the cards have been viewed.
Any help with the code would be greatly appreciated. Is there a way to send the user back to the previously viewed frame? Would the "return button" span all the answer frames, the way the shuffle button spans all the question frames? Would you need a different "answer button" for each answer frame, and would the code for that button be attached to the button or included in the actionscript code in the "actionscript" layer?
Thanks!
Bill
Some Questions .. I Need Answers Please
Well how to:
1. i put a clock in my animation ... can i control a movie clip with this clock ?? ... i use this animation in web page for restaurant ... i just want to define in wich hours will animation shows OPEN or CLOSE ... where i can specify that for each day in week ??
2. i made an animation with one frame and two layer ... in first layer is one object and in second layer are two buttons .... wich code i must use to .... when i press the first button, the object will jump to another position .... with seccond button, the object will slide to another position .... i need this for changing position .. alpha value ... color ..etc
3. in one web page i have two diferent animation 1.swf an 2.swf .... in 1 are buttons ... in 2 is text ... can i control animation 2.swf with
buttons in 1.swf ? I heard that i must java code for this ??
Answers To Raypatrick And FaithBlue
This forum just doesn't work anymore.. so answers:
To raypatrick:
mc._currentframe+15
to faithBlue
http://www.macromedia.com/support/fl...cript_comm.htm
javascript communication
gparis
Seeking 2 Answers For 2 Problems
I searched for answers, but I found none, so I bring them to the board.
1) How can you change the HTML background from a button inside of Flash?
2) How can you detect the users screen resolution in Flash 5? Can it be done using Actionscript?
Quiz ...but Which Allows Combination Answers ?
Hello everybody!
My new project is a quiz for school children.The students have to key in the answers.The answers could vary from student to student.....say for a question on physics.the answers could be 1kg/cm2 or 1kg/sq.cm or one kg/cm2 etc,could anybody suggest a code for validating against more than 1 possible (combination) of answers.Iam not so good in scripting but comfortable with basic actions
Thnking you.
Vinod
Randomizing Questions And Answers
I tried posting once already, but I still haven't had any luck on my own so here goes.
I have randomized the order in which multiple choice answers come out of an array using the code below, but I haven't been able to randomize the order in which the quetions themselves appear to the user. Any advice/help would be appreciated!!!
Thanks!
-----
function display() {
gotoAndPlay("gameover");
} else {
answers = shuffleArray(zArray[questionNumber][1].slice(0));
question.text = zArray[questionNumber][0];
answer0.text = answers[0];
answer1.text = answers[1];
answer2.text = answers[2];
answer3.text = answers[3];
questionNumDisplay = questionNum+1+" of "+zArray.length;
correctAnswer = zArray[questionNumber][1][0];
animateIn();
}
}
function shuffleArray(array1) {
array2 = new Array();
do {
r = int(Math.random()*array1.length);
array2.push(array1[r]);
array1.splice(r,1);
} while (array1.length > 0);
return(array2);
}
-----
I Have A Problem That No One Answers Right... :(...please Read
I need help on this subject, everyone else that tried ( thank you all) have sent me to a tutorial or to a help file. I couldnt work with those, the tut they sent me to was for like flash 3 and i have mx and the help files from macromedia were monsters with the go to 16155 for this information and go to 19763 for that information... yikes... i felt this was a simple thing but i failed misserably and am requesting the help of the experts in actionscript board. Thank you for your time patience and understanding
Count Correct Answers
Hi,
I'm going to create an exercice (for educational purpose) where people have to fill in gaps. I'd like to have some kind of "Check" Button that "counts" the correct answers and returns this in "x % correct".
Any ideas how to do this?
Thanks in advance?
Natsurfer
Help I Need To Create Random Answers
CAN SOMEONE PLEASE HELP ME???
I want to create a situation where the viewer can press a button and a random answer will appear!!! They will all be answers to the same question but I don't know where to start!!!
Thanks Rebecca.
Simple (hopefully) Answers For A Newb
Just wanted to know, i'm making a flash site and i just have a couple of questions..
A lot of flash sites (i think) seem to navigate within the same swf, I assume,therefore, between different scenes, and the url does not change, where as other sites which use flash just flick between pages like a normal website as a means of navigation...
are there any problems with the first way (i like the idea of the navigation being smooth so i can animate a bit between links) or is it bad to have a big swf file? hard to load or something?
Another thing i noticed with flash sites that have a smooth navigation, there's often a cool loading bar graphic 50% 100% etc...
is that just for show or is there really a way to make a graphic appear and alter according to the user's loading... hmm
here's an example of what i mean if i'm not making sense
http://aroots.com/main.html
click on the "r" for graphics...
i'd like to do something similar (and less cool no doubt) for displaying pics, rather than loading a new page each time...
any advice would be great
on a side note, some difficulty i'm having at the moment, it's really simple action script but i'm retarded and can't seem guess it right...
at the last frame of my movie i want each button on rollover to play a movie clip as well as function normally as the button, just want it to trigger a little animation on that same frame, movie clip "sparkle"
can someone put me out of my misery?
Common Prob. No Answers, HELP
Hey. Thanks for taking the time to look.
My SWF is hiding my DHTML dropdowns. Searched this issue and apparently I am not the only one. There is no work around or solution posted in any previous posts. Has anyone found the needle in the haystack?
Thanks,
1M.
|