ActionScript 2.0 :: Only Show Button If User Gets To Certain Score

Mar 23, 2010

I have recently created a quiz that allows user to submit score to database, however I only want the submit button to be available if the user scores 100 % (all questions correct). This is the actionscript used on the final summary screen. is there a way to add to this? if userScore = 100 then display submit button, else leave blank.

Code:
userScore=(numOfQuestionsAnsweredCorrectly*100)/
(numOfQuestionsAnsweredIncorrectly+numOfQuestionsAnsweredCorrectly)
stop();

View 3 Replies


Similar Posts:


Actionscript 3 :: Make A Score Counter For A Small Game Where The User Clicks On A Button On The Stage?

Mar 28, 2012

I have been trying to make a score counter for a small game where the user clicks on a button on the stage, each time the user presses the button the score increments by 10, however I cannot get the score to display on the dynamic text field.

var score:uint;
//scoreCounter is the instance name of the dynamic text box
function updateScore():void{
score += 10;
scoreCounter.text = score.toString();
}

View 2 Replies

ActionScript 3.0 :: Show/Hide Button Functionality For User?

Jul 13, 2011

I have been tasked with adding button functionality for a fence companies flash application. Specifically, the buttons will be in a drop down horizontal menu. They will have to display (and hide) certain accessories that will be placed on the fence or are a part of the fence itself. For an example of something similar, please check out the design studio at this site -[URL]. It is the application about halfway down the page and after hitting the APP MENU button, it is the top most option.note that as the fence moves (by scrollers) the accessories always stay with the fence. So, I am guessing that the whole thing is a movieclip and that the buttons are referencing?, showing?, hiding? certain aspects of the movieclip.

View 1 Replies

ActionScript 3.0 :: How To Save User Information And Score

Dec 15, 2009

I'm working on a project using AS3 and timeline coding. I can't figure out how to save user information and score. When I run the movie and complete form and answer quiz questions, information is displayed on closing section, but it doesn't save.
 
Here are the main sections by label:
 
// SECTIONS
Introduction (labeled "intro") -- contains directions
Information (labeled "inf") -- collects user information
quiz-questions (25 questions -- from q1 to q25) -- presents questions

[code]....

View 4 Replies

ActionScript 3.0 :: Score Board For A Game Show?

Jun 7, 2011

I need to create a score board for a game show at work for staff. The score board must keep score on the left and right parts of the screen. score must start as default on 0. Then every time I press for example the left arrow key the left score must increase by the value of 1 and when I press the right arrow key the left score must decrease by 1.Same goes for the right score only with differant keys example up and down keys. This sounds very simple and I managed to get it to work when I tested with only 1 score, but failed when adding the second score to the picture.

View 5 Replies

ActionScript 2.0 :: Show MyMessage When Score Reaches 10?

Mar 18, 2010

I want to show myMessage when score reaches 10. But these lines doesnt work.

score = 0;
if (score = 10) {
myMessage.text ="WIN!";
}

View 5 Replies

ActionScript 3.0 :: SharedObject - Save User Information And Score

Dec 16, 2009

I'm working on a project using AS3 and timeline coding. How to save user information and score. When I run the movie and complete form and answer quiz questions, information is displayed on closing section, but it doesn't save.

Here are the main sections by label:
// SECTIONS
Introduction (labeled "intro") -- contains directions
Information (labeled "inf") -- collects user information
quiz-questions (25 questions -- from q1 to q25) -- presents questions
closing (labeled "closing") -- displays user information plus score on quiz.

Here is the code by section
// SECTION INTRODUCTION
Section "intro" --- I have one button that goes to "inf" section
stop();
intro_bt.addEventListener(MouseEvent.CLICK, gotoInf);
function gotoInf(evt:MouseEvent): void{
[Code] .....

View 2 Replies

ActionScript 2.0 :: Submit User Score And Name To Database Table

Apr 22, 2008

I am basically having a problem in submiting the users score and name to the database table. When the user reaches the final score screen they are shown two dynamic text boxes that display there total result and a input text box where the user can enter their name. I have done everything and it still don't work. I know I can receive the data but I don't get why it doesn't submit it to my table.
The input text box has a instance name of "playername"
Score total dynamic text box 1 "correct_total"
Score total dynamic text box 2 "wrong_total"
I have also attached an image of my database table [URL].

PHP files. insertValues.php
<?php
$host = "localhost";
$user = "root";
$pass = "";
$database = "activitysystem";
[Code] .....

View 3 Replies

ActionScript 2.0 :: Timer And Score-keeper Only Show Numbers 1 And 5?

Oct 4, 2011

I'm designing in AS2 - because for some reason, i thought this tutorial was made for AS2 - is this AS3 code and is that the problem??The Problem. The game runs fine, but the score keepers (both for hit and missed balloons) only show the numbers 1 and 5. so if i pop one balloon, it says 1. then for a score of 2, 3, and 4, it is blank. until i pop that 5th balloon, then it says 5, then back to blank for a score of 6.Even stranger (to me) is that the game has a count-down timer that counts backwards from 60. it also only shows then the time has a 1 or a 5 in it. same as the scores.

View 4 Replies

ActionScript 3.0 :: Create A Game Where Circles Appear On The Stage And When The User Clicks On One It Disappears And Their Score Is Updated?

Dec 12, 2009

I'm trying to create a game where circles appear on the stage and when the user clicks on one it disappears and their score is updated. The circles appear for a short time then dissapear. If they dissapear before the user clicks the user looses points. The game is to last 20 seconds then the user will be shown their score and a little thanks for player message. This is what I have so far:
 
stop(); 
addEventListener(Event.ENTER_FRAME, playGame);
function playGame(Event):void    {

[code]....

Now what I'm having trouble with is all the timing. I need a way to turn the visibility off the circles after a few seconds of being created and I also need to set the duration of the game for 20 seconds.

View 5 Replies

ActionScript 2.0 :: Store A Simple Cookie That Will Remember The Score For The Next Time The User Plays The Game?

May 6, 2007

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.

View 1 Replies

ActionScript 2.0 :: Get Score Text Box To Gotoandplay Another Frame - Scene When It Hits A Certain Score?

Aug 10, 2004

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??

View 4 Replies

ActionScript 2.0 :: Score - Movie Go To Frame 3 If The Score = 500?

Feb 17, 2004

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

if (_root.score == 500) {
gotoAndPlay(3);
}

View 2 Replies

ActionScript 3.0 :: Cant Reset Score With Button

May 7, 2010

I've been making this animation for a Uni project but i've come across some really annoying bugs which are stopping me from getting the top marks and I was hoping someone here could help!

-Cant reset score with button

-Can't move to next Scene

I wasn't sure where the best place was to upload the .fla so I picked mediafire.so far in my attempts to fix the reset score i've tried adding.[code]

View 2 Replies

ActionScript 3.0 :: Create A Button That Increases Score

Aug 15, 2011

i am new to actionscript and i cant figure out how to create a movie clip that increases the score at the bottom. this will eventually be part of a game that will involve the button moving randomly around the screen.

View 21 Replies

ActionScript 3.0 :: Button Adds To Total Score?

Dec 3, 2009

I can find my way in Actionscript 2.0, but 3.0's hell for me. I've been following a bunch of tutorials and I suppose I understand the 'basics', although I'm beating myself over this 'cause most of you will probably consider this basic aswell.

The problem at hand : I made a few movieclips, that have a transparant button on the first frame inside of them, and on layers below it an animation that starts once you click it, then stops at the last frame.

(Example : You see a snail, you click it(but really click the transparant button that's above it) and the movieclip starts playing, showing a snail that crawls back inside it's shell, then it stops. Pretty simple, but it's a fun and easy way to have multiple interactive graphics on a page.)

The task at hand : Somehow make a score system that allows you to see how many of them you've clicked, meaning everytime you click a snail (for this example, anyway) there's a +1 function somewhere.

Currently, inside the movieclip (the transparant button) I have :

stop();
alpha_btn.addEventListener(MouseEvent.CLICK, nextClick);
function nextClick(event:MouseEvent):void{
gotoAndPlay(2);
}

Which is pretty straight forward. alpha_btn is the button that makes the animation inside the movieclip play. At frame 30, there's a stop(); function.Then, there's the main timeline.

function scorePoints(myPoints:Number):void {
if (Number(scoreBoard.text)) {
scoreBoard.text = String(myPoints);

[code]...

It works, but only once. After the snail is clicked, I have it looped (no stop(); at the end of the moveclip, but it moves to the first frame again. Meaning, the button's there again and it's clickable again.) but everytime I click it after that, there's no points added to it.So I'll break it down to this : I need simple button that, when clicked, adds a number of points to the scoreBoard.

View 4 Replies

ActionScript 2.0 :: Button And When U Click It, 1 Point Is Subtracted From Score?

Mar 30, 2009

So i have a button and when u click it, 1 point is subtracted from your score, and it takes you to frame 2. So i said this:

on(press){
gotoAndPlay(2)
_root.money-=1
}

This works okay, but it only plays frame 2 every other time you click it, but adds one to your score everytime you click it. What can i do

View 1 Replies

ActionScript 3.0 :: Score-- And Increase On Button Click Not Working?

Mar 28, 2011

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)
{

[code]........

View 2 Replies

ActionScript 2.0 :: Create A Button That When It Is Pushed It Increases A Score?

Jul 25, 2009

I am trying to create a button that when it is pushed it increases a score, but for some reason when it is pushed it only adds the score once. Here is the code

View 2 Replies

ActionScript 1/2 :: If Score Over Certain Point Next Level Button Visible In Game

Oct 2, 2009

I'm making game, where I must collect points. In end menu screen, i want that if my score's over 200, a next level button will be visible. Now it's visible every time when timer's out. I have tried this code
if (score < 200){
this.visible == false;
} else
if (score >=200){
this.visible == false;
}

View 3 Replies

Actionscript 3 :: Multiple Dynamic Text Score Display - Modifying Each Text One After Another And Incrementing The Score By A Certain Number

Feb 23, 2011

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.

View 1 Replies

Show A Static Pic If The User Doesn't Have Flash Installed?

Oct 7, 2009

check out this website first for what I'm going for:

[URL]

The header is a graphic of a guy's head and a car.

I want to design the same kind of page but my header graphic will have a cartoon head instead of that guy's head and it will animate.

Now If the user does not have flash installed I would like to have a static header image appear, like a .jpeg or a .gif, instead of the .swf header.

View 2 Replies

Actionscript 3 :: Flash - Only Show Message On Load If User Is Not Already Over The Movie

Apr 13, 2011

I have a flash movie, that shows a message to a user when it first loads up. When the users mouse enters the stage or moves the mouse the message disappears. However I would like to hide the message if the users mouse starts over the flash movie on the page load. Is this possible or does it need an interaction first?

View 1 Replies

ActionScript 3.0 :: Show Msg To User Based On How Quickly Game Completed

Sep 3, 2011

I've developed a game that records how long it took to complete the game. At the end of the game it shows the user how long it too to complete. I want to be able display message to the user depending on how quickly they took to complete the game. I have set up a dynamic text box called "message" that will display the message, but I am struggling to figure out the syntax for :

If gametime is less than 60 secs then message = "well done thats very quick"
If gametime is between 60 and 80 secs then message = "Not bad at all"
If gametime is between 81 and 100 secs then message = "Its good but not good enough"
If gametime is between 101 and 120 secs then message = "You can do better than that!"
If gametime is between 121 and 140 secs then message = "Too slow, you need to practice"
If gametime is greater than 140 then message = "Did you fall asleep?"

View 3 Replies

ActionScript 1/2 :: Write The Code When The User Is On FRAME 10 To Show The Same Text In B_text?

Jul 5, 2010

In frame 1 I've got a_txt

In Frame 10 I've got b_text
 
How do I write the code when the user is on FRAME 10 to show the same text in b_text?
 
I tried this on frame 10 and it didn't work. b_txt.text = a_txt.text

View 7 Replies

Flex :: Show Email In Textbox When User Select Any Item In The Grid?

Feb 2, 2010

i have following xml

<?xml version="1.0" encoding="UTF-8" ?>
<Users>
<User>
<ID>SMSUser(63)</ID>

[CODE]...

How can i show Email in textbox when user select any item in the grid?

View 2 Replies

ActionScript 2.0 :: Multiple Clicks - User Can Click On To Hide / Show A Different MovieClip

Feb 27, 2008

I have a movieClip that a user can click on to hide/show a different movieClip (for this example, lets say its a circle). I have an 'onPress' on that movieClip that tells it go and play the next frame inside itself movieclip (there are two frames which just have different graphics to represent off/on) and also the line of code to hide the other movieClip.

The problem is that if a user clicks on the movieClip to hide the circle and then keeps their mouse in the exact same position and tries to click again to show the circle, nothing happens... they have to move the mouse at least a little bit before it will recognize it is being clicked again. The same thing happens with buttons I have that scroll the page... which is extremely annoying since you can't just click the same spot multiple times, you have to move your mouse a bit and then click again.

View 6 Replies

ActionScript 3.0 :: When The User Clicks The "exit" Button A Class File Is Called To Mark The User Complete In An LMS?

Oct 4, 2010

I have a problem with a dynamic video player that I have created in flash. The video player is "SCORM" compliant so that when the user clicks the "exit" button a class file is called to mark the user complete in an LMS.I have tested the SCORM Code previously and it works with out issue. Usually I have the completion code embedded in an Actions Layer of the movie. This is the first time I have attempted to call the completion status in a class file, I have added a "trace statement" when the movie is tested within flash it runs the trace statement properly, but when uploaded to the LMS environment the course does not complete properly

View 3 Replies

Flex :: Any Method In Module Class Where I Can Hide And Show Based On User Login?

May 19, 2010

<?xml version="1.0"?>
<!-- This module loads an image. -->
<mx:Module width="100%" height="100%" [code]..........

I have such 10 modules. Is there any Method in Module Class where i can hide and show based on user login.

View 1 Replies

Actionscript 3 :: Detecting Out-of-view Flex Controls - Hide And Show Based On User Context

Sep 10, 2009

In my flex app I have custom tooltips on buttons that hide and show based on user context. The problem that I dealing with is that when I call my showTips() function I only want to show tooltips on the buttons that visible in the view. So buttons that on a un-selected tab (tabNavigator) should not show the tooltips. For some reason all tooltips are showing. Is there a way to detect if a button is not in current view, like on a un-selected tab?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved