ActionScript 2.0 :: Quiz Score Not Working - Remain Same All The Time
Mar 25, 2007
I'm trying to create a simple quiz with a few questions, the code I have below doesn't seem to work. It comes up with my final score as -15 all the time, its not even checking to see if the answer is correct, as soon as I load the movie the Output comes out as -5 -10 -15.
quizBut.onRelease = function() {
totalOutput_txt.text = "Your final score is: "+score+"/30.";
};
score = 0;
if (_root.answer1 == "flush") {
[Code] .....
I have a working quiz but I want to know how to get the score of the number of correct answers the person got but I can't seem to figure out the code for it. This is my code below.
stop();// movie clip waits on buttonsgloss_mc._visible = false;// set the gloss initially to not visiblescore_int = 0;// score on the quiz is initially zero// button functionsq1_btn.onRelease = function() { scoreQuiz_fnc("1");};q2_btn.onRelease = function() { scoreQuiz_fnc("2");};q3_btn.onRelease = function() { scoreQuiz_fnc("3");};q4_btn.onRelease = function() {
I've been fiddling around with the flash quiz template and it's pretty much what I need to a point. But I really just need is to know how to keep score?
I'm working on a quiz using AS3 on timeline. I can't figure out how to save the score at the end of the quiz. The result of quiz is displayed by its dynamic text box (out_score.text), but it isn't saved along with the rest of information. When I go back to section I, all information is displayed, but quiz score goes back to zero (0). I have section I, which collects user information. Section II, 25 question quiz, and section III, which displays information and score.
SECTION ONE (labeled "inf"): // score variable var i:Number=0;
I am working on an eLearning lesson that needs to score quiz results using a statistical formula called a probit function. There are formulas in many languages (VB, C++, etc.) for the probit function, but not in AS3. The closest I can find is in JavaScript.
Do anyone know of a way, or a site that mentions how to make a quiz in flash, or time activation in flash. .For instance if the xml says that something starts at 6 o clock and ends 12 o clock. and then something else starts after that. How do you do something like that in flash?
I have a score that goes up by 10 every time you press this button, its var "score". I have a simple countdown timer. caller, its var "timer". When the game ends it goes to the next frame which says game end. I can get the score to show but I want the time left to be added to this. I have tired: onEnterFrame (){ score = Number(score) + timer; } Nothing seems to work. Do I even actually use onEnterFrame ?
Is there an actionscript for a point system? I want my points to be time based from this script stop(); count = 60; countdown = function(){count--; if (count ==0){clearInterval(doCountdown); gotoAndStop(11); clearInterval(doCountdown); }}doCountdown = setInterval(countdown, 1000);
Anyone know where to start thinking about logic for an XML quiz with multiple correct answers, that when the user gets the question right, that question is removed from the random array of questions so we never need to answer it again?
I've got two textboxes txt7 and txt9. First shows percentage right (working) and second is conditional if less than 70% shows "should repeat this" (working) but if 100% the "well done" doesn't show.
txt7var = Math.round((new_score/4)*100); // convert score to percentage txt9var = ""; this.onEnterFrame = function() { if (this._currentframe == 'score') {
I'm following a tutorial to make a simple game. The aim of the game is for a player to evade a flying enemy ; the higher the score, the faster the enemy. The main elements in the game are the enemy the player and a score card.
However, from following the tutorial, and adding the dynamic text field etc....the score doesn't actually work.
This is the code that I was instructed to place on the first frame of the Scripts layer:
//Game Variables enemySpeed = 5; //Set Enemy initial speed numberEnemy = 4; //Change this to add more Enemies score = 0; //Set initial score to 0
My problem is that I have a countdown for a variable called health, that works fine, it decrease the score over time, my problem is that I'm trying to have a button, that when clicked increases the health variable by 50, it works fine in Debug, it shows that the variable is being updated, but when I run it normally, it just doesn't update. Here is the offending code:
ActionScript Code: public function countdown(e:Event) {
I'm following a tutorial to make a simple game. The aim of the game is for a player to evade a flying enemy ; the higher the score, the faster the enemy. The main elements in the game are the enemy the player and a score card.However, from following the tutorial, and adding the dynamic text field etc....the score doesn't actually work.This is the code that I was instructed to place on the first frame of the Scripts layer:
//Game Variables enemySpeed = 5; //Set Enemy initial speed numberEnemy = 4; //Change this to add more Enemies score = 0; //Set initial score to 0
I'm just trying to store a simple cookie that will remember the score for the next time the user plays the game (the score governs if an option is visible or not)It all works fine until I close browser/reload the page, at which point the shared object seems to disappear, any clues?
Write:
Code: var rem_score:SharedObject = SharedObject.getLocal("score"); rem_score.data.score = new Number(score); rem_score.flush();
The problem prolly lies in my write code but ill post the reading aswell just incase there is a problem with that too
Code: var rem_score:SharedObject = SharedObject.getLocal("score"); if (rem_score.data.score != undefined) { this.remdscore = rem_score.data.score; if (rem_score.data.score >=30) {
[code]...
There is another point it is read but it is the same sort of thing as the above.
Im designing my own game in flash, iv set up a score text box and it works fine. Except i just cant seem to get it to gotoandplay another frame,scene, when it hits a certain score??
i am building a shooting game and i was wondering if it is possible to have the movie go to frame 3 if the score = 500.I.E Score is displayed in a dynamic text box and everytime the enemy is hit the:
_root.score +=50 ============= on the first frame of the film i have the code
First line: Loading the movie into the instance Second line: Loading some vars into my scene third line: make the popup appear with an alpha tween fourth line: proving the itemName is correct.
Problem: First time running this script results in not showing my movieclip Second time running this script everything works perfect.
Is there a way to get this code to work? It's meant to count the seconds passed while playing the game and gives a bonus multiplier to the current score when the game ends. I don't know how to get the returned value to combine it into the multiplier int variable. Is there any way to get this code to work or is it completely wrong?
I have a result screen that shows bonus points and such. I want each text field to increment one after another and also have it increment by a certain amount each frame. Result Screen pops up. First is the player score check the player score, is it more than the score we want to display if the player score is greater than the player display score by 100 increase the player display score by 100 if the player score is greater than the player display score by 10 increase the player display score by 10 else increase the player display score by 1 when finished move to the next score...and so on. I have thought of using timers to move from one score to the next, but not being in an Event.ENTER_FRAME it only does one if then moves to the next one.
Also the if statement for incrementing the score looks ridiculous and I'm thinking there has to be a better way to do it. I was thinking of making it a separate function but then I wouldn't know what to return, or how to return it so it looks like its increasing and not just showing the total number instantly. I'll try to expand on it a little more.
I have 12 movieclip buttons which each contain a question. When you click on one, the answer appears. I need the answer to remain on the screen. On that same frame, there's a button for "more information".When that is selected, it goes to another frame within the mc, and more info appears. However, it is covered up by the other 11 buttons from the main screen
I am trying to create a series of buttons that when finally "clicked" will simply stay on or in their "hit" state. This is not for a web page at all, but for an interactive SWF. Now, I've come to the conclusion that I can't do this with a button graphic so I've created a four state button movie clip with the aid of some online tutorials. Unfortunately all the tutorials end with a URL reference and I simply want the button to function like a button until it's clicked... and then freeze there until the SWF is run again.[code]
I am making a flash website that loads 20 external swf files and I am having problems unloading them. after many tests I noticed something strange : When looking at the memory load of the browser in the task manager, I can see that each swf file will add memory load the first time it's loaded (which will remain even after calling unloadAndStop), that memory load will double the second time the file is loaded but after the second time the memory load does go down when unloadAndStop is called.
I tried a bunch of things but I can't seem to find the right thing to do. I tried removechild before calling unloadAndStop and the memoy load was only going up. Since those external files have many HD images, each one adds around 100mb of memory so it's a very big problem.
First,I have a menu screen for my game, but for some reason the buttons remain during the game (not visible), I think I need to use swapDepths but I'm not sure. Second, I need to make a restart button from the Game Over screen but I'm not sure of the coding I need to use,would using something like this work?
Is it fine to display the output of Array.toString() to the user, or is there a possibility that the string format could change in future versions of ActionScript 3 or other compilers?
I have a simple movie that just runs to the end and stops. When it stops, I want an object to appear and remain visible while the movie is sitting there in its stopped state. Trivial. My current model of the Flash stage is that if you drop an object onto the stage, it's there for the whole movie and it's up to you to move or hide it to get what you want. (That is, you can't add an object to the last frame of the movie, at least without bringing ActionScript into play.)
So, as far as I can tell, the only way get what I want is to add the object to the stage, make it into a button, and use alpha control to hide the object/button until the last frame of the movie, when the alpha goes from 0 to 100. This works, but I'm filled with the feeling of "this has to be overkill". I'd have the same feeling if I started the movie with the object off-stage and moved it on-stage in the last frame. Is there a more reasonable / lighter weight way to do this?
I have a flash quiz that I created. The file is an external swf loaded on top of another flash swf. The quiz is all radial buttons and drop down menus. Once the user choose which answer they feel is correct they click submit. Before they click submit they have an option to close the window. What i want to happen is if they close that window and return I want those selected answers to remain or even if they submitted before; i would like for those answers to remain.
It's about a website where a Photo Gallery exists. It all works fine until I press the Gallery button and then try to go elsewhere. The photos not only they remain on the page (the text and other images load normally on the current page, but under the gallery photos), but if I press the Gallery button again after pressing another button, it keeps loading those images over the previous ones. The code:
I am trying to create a drag and drop tutorial by building a chemistry set.
The object of the tutorial is to drag and drop the appropriate instruments onto the target to build the kit.
I have the chemistry stand which had been designated as the target and five instruments which the user can drag and drop though only one will connect to the stand and send the user to the next frame. The instruments that are not correct snap back to their original position.
This process continues over 6 seperate frames.
The whole drag and drop process works fine, the only issue is that when the user picks up the wrong instrument and it snaps back to original position, and the user then picks up the correct instrument and send the user to the next frame, the wrong instrument (only the one that was picked up) is behind all the other new objects.
How do I get the wrong object that was picked up in the previous frame to not be in the new frame?
I have also included the actionscript for both the correct and and incorrect instrument.
I got a project containing 4 movieclips to be duplicated by random and placed on a certain position on stage.all movieclips are placed on top of on another.the problem is: already placed movieclips don't remain on stage - they get replaced by the next movieclip duplicated in.How can I make the already placed clips stay on the stage?