ActionScript 3.0 :: Using Buttons To Select The Correct Answer?

Dec 22, 2010

I have a simple game I am attempting to write. random movie clip (from the library) is displayed on the stage from an array of mc's  Here's the question. What my game will do, is allow the user to select one of two buttons (red and green) based on the movieclip that is displayed. One will yield a correct result and the other will yield an incorrect result.HOWEVER, depending on the movie clip displayed, sometimes the red button will yield the correct result and sometimes the green button will yield the correct result. I am having trouble figuring out the best logic in writing code to accomplish this.

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Get An Answer From Input Text Field And Compare It To The Correct Answer?

Jul 8, 2010

I am trying to get an answer from Input text Field and compare it to the correct answer.here is how my code look like:

//I have a confirm button here
confirm_button.addEventListener(MouseEvent.CLICK, ConfirmFunction);
//I have a correct answer as a String here
var correctans:String = "July";

[code]....

This will check if correct answer contains words in the answer from input text field.But that will result on if I key in "July is great", it will still link to the correct answer frame instead of wrong answer frame.I want the answer to be exact same as the correct answer.

View 4 Replies

Professional :: Multiple Choice Quiz - How To Set Correct Answer

Jul 1, 2010

I'm using CS4 and trying to create a new quiz using one of the templates.I can see how to edit it to get only Multiple Choice but I'm stuck at one thing - I can't see where to specify which choice is the correct one.

View 4 Replies

ActionScript 1/2 :: Input Text Will Not Allow To Access The Correct Answer

Mar 8, 2012

i am trying to create a simple quiz in school. I have one test question which requires the answer to be -1.I have created Input text and assigned the variable answer for this question.I have a button with the following AS2 script: 

on (press, keyPress "<Enter>") {
if(answer eq "-1" or answer eq "minus 1"
or answer eq "Minus 1" or answer eq "Minus one" or answer eq "minus one")

[Code]....
 
Firstly whatever you type the numerical keys are immobilised on the keyboard when the .SWF file is builtSecondly I cannot enter the correct answer!! If I type in Minus 1 etc it goes to frame 3.I have tried flags rather than frame numbers - same problem.i have tried remaking the quiz as a  separate file.using CS4 and CS5 flash - windows 7 PC.

View 6 Replies

ActionScript 3.0 :: Drag And Drop - How To Get Correct Answer On Stage

Feb 6, 2011

Basically imagine a stage with 1 question on it and 3 possible answers. All the answers are draggable and the correct answer must be dragged to the answer area. If the wrong answer is dragged it bounces back... The problem (which in my opinion seems quite basic) is when the correct answer is dragged onto the answer area, I can't get it to do much. I can run a trace and that works so I know its setup correctly but I think i'm coding it wrong within the IF statement. My entire code for the correct answer is kept in a seperate as file and I have listed it below:

package code {
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.geom.Point;
public class Three extends MovieClip {
[Code] .....

The bit where it says " if ( dropTarget.parent.name == "answer" )" I'm presuming is where the code has to go. I want to either goto a frame label within the main timeline which says "Congrats" kinda thing OR the other way I can think is adding a movie clip to the stage with the congrats msg in.

View 1 Replies

ActionScript 2.0 :: Get The Correct Answer If Click The Red Color And Fill Into The Star?

Mar 25, 2012

i am develop 1 simple game for color fill to object, but now i have something wrong in my code...how do i get the correct answer if i click the red color and fill in to the star?

View 4 Replies

ActionScript 3.0 :: Create Flash Quiz Based On Circling The Correct Answer?

Dec 27, 2010

I am quite new to actionscripting and need to create a flash based quiz.The user will have to circle the correct answer in the quiz.I do know of drag and drop function but didn't know how to create circling function.

View 11 Replies

ActionScript 3.0 :: Select The Correct MC And Remove It?

Mar 16, 2009

I have 4 buttons that just tween a large MC. When I tween something though It loads the content to be tweened. After that if user clicks another tween I need a a way to remove the last thing that was just tweened. not methods, just a way to select the correct MC and remove it.

View 1 Replies

ActionScript 2.0 :: Button Is Pushed A Answer Is Displayed And On The Answer Frame?

Aug 27, 2010

I have a grid with 12 movieclip buttons. When a button is pushed a answer is displayed and on the answer frame, there's a button "click for more information".

That button points to information in a frame within the mc button. However, when I test it all the buttons on the root timeline appear on top of this information, covering it up.

Also, when you move the mouse while in this "further info" area, it disappears

View 1 Replies

ActionScript 3.0 :: RadioButtonGroup - Can Select All Buttons

Apr 8, 2009

My code is supposed to read an XML file, and present a question with 4 possible answers to the user. I am outputting my data fine, and even outputting corresponding radioButtons for my multiple choice question. I must be handling my radioButtonGroup incorrectly as when I test my movie, I can select 1, 2, or even all of my buttons. My trace statements outputs each button with the same group name.

[Code]...

View 1 Replies

ActionScript 3.0 :: Select All Buttons Except CurrentTarget?

Jul 4, 2010

I have a set of 6 buttons and upon clicking one of the buttons i want to tween the others that were not clicked to fade out.

View 3 Replies

ActionScript 3.0 :: Select 2 Buttons In Same Time?

Jan 9, 2012

I'm trying to make a multiplication game, with

123456789 as buttons on the left side

123456789 as buttons on the right side

my goal is to select 4 on the left and 7 on the right, and in the middle to see the result 28. but I don't know how to make 2 buttons to stay selected

if I press 4 on the left, it gets selected properly, and the effects show OK but if I press 7 on right, then 4 deselects, and I'd like 4 and 7 to stand out as selected buttons in the same time

View 7 Replies

ActionScript 3.0 :: Next And Previous Buttons Are Not Working Correct

Jul 10, 2011

why the buttons are not working correct?

View 2 Replies

Professional :: Set A Default Pre-select For Radio Buttons?

Apr 7, 2010

I have some text form fields that I've set up to display some paired variables stored in a .txt file. When the swf loads, the form fields are populated with the text.I've also set it up so that if you change the text and hit a submit button, the .txt file gets updatedI'm now tryng to set it up so that I can store radio button selections in the .txt file too.I've started doing it a certain way, but am wondering if there is a more straightforward way of doing I've set up the butttons to spit out "on" or "off" depending on the selection, and apply that to the variable that gets stored.the text form fields when the swf is refreshed, I want to load the on/off variable, and then somehow apply it to the radio buttons so that one of them is pre-selected.

View 1 Replies

Professional :: Let User Select Multiple Buttons?

Oct 18, 2011

I was wondering, if I had an image with multiple sections that are highlighted on rollover(like a car), and I wanted to give the user an opportunity to select multiple sections and on release they are taken to a page that displays relevant info on each clicked section, how would I go about doing that?

View 2 Replies

ActionScript 2.0 :: Multiple Radio Buttons, Select One?

Nov 30, 2005

I have 5 radiobutton. They have all been grouped into the Groupname HR_value Each of the radio button have the names: hr1 , hr2 and so on.

If I write: _root.line1.vv1.hr1.selected= true I get the result i am looking for. But I know want this to be contingent upon the value of a variable called temp:

var temp
temp=1
_root.hr[temp].selected= true

.....this does unfortunately not work.

View 6 Replies

ActionScript 2.0 :: Buttons In Array - OnPress Correct Sequence

Feb 10, 2011

I have pressed the buttons in a array. The objective is press the buttons in the correct sequence.
Correct sequence click "btn1 and btn2" or " btn2 or btn1"
Correct sequence click "btn3 and btn4" or " btn4 or btn3"
Inc correct sequence click "btn1 and btn4" or " btn4 or btn1"
and so on.

I've place a trace the button is returned undefined.
ActionScript Code:
var buttonArray = new Array(btn1, btn2, btn3, btn4);
var clicks = 0;
for(i =0; i < buttonArray.length; i++){
buttonArray[i] .onPress = function(){
trace(buttonArray[i] + "click");
}}

View 9 Replies

ActionScript 2.0 :: Movie Clip Buttons Not Directing To Correct Frames

Feb 17, 2010

It's supposed to cause each of five movie objects to correspond and go to a different named frame when they are clicked. The problem is that regardless of which one is clicked, it always goes to "animation." I tested it out by changing the name of the animation frame. The result was that it then always went to the "publication" frame. It would seem that it goes to the last valid named frame in the script.[code]...

View 2 Replies

ActionScript 3.0 :: Created File Where Navigation Buttons Go Correct Sections

Aug 24, 2009

I have created a file where the navigation buttons go the correct sections.Once there I have different buttons at the bottom of the page to navigate.Do I put the action on the frame (Portfolio,About,Contact) to return home, play my portfolio, contact me?I tried it... I got a duplicate error.[code]

View 2 Replies

ActionScript 3.0 :: Basic Buttons - Advance User To Correct Frame Labels And Stop

Sep 13, 2010

I have a flash site that has a presentation page it has a menu of two buttons (1) to take you to a slide show and (2) that takes you to the gallery. These are the only two buttons that seem to work in control test movie, I get no errors. The only button that is connected is the slideshow button (I haven't done the gallery yet). This button takes you to frame two. Where I have the main website. It has its own menu that spans across the entire website which is 25 frames.

Each frame represents a new page. I have mini menus at frames 3, 5, and ten. That are supposed to just advance the user to correct frame labels and stop. The only buttons that work are the ones in the first frames. The rollovers appear to work on all the pages when I advance the movie using the [ . ] key but I get no trace statement which means that it is not being acknowledged, all my buttons are named properly I believe so here is the code as well, all is in frame one:

stop();
//handle events for buttons...
Gallery.addEventListener(MouseEvent.CLICK, clickSection);
Home.addEventListener(MouseEvent.CLICK, clickSection);
Location.addEventListener(MouseEvent.CLICK, clickSection);
Guest.addEventListener(MouseEvent.CLICK, clickSection);
Lodging.addEventListener(MouseEvent.CLICK, clickSection);
[Code] .....

View 10 Replies

ActionScript 3.0 :: Get The Depths Of All The Blocks To Be At The Correct Levels At The Correct Times

Dec 30, 2009

I'm trying to get the depths of all the blocks to be at the correct levels at the correct times so that the 3d effect is maintained. I've tried many things, but have had little success. All the instances of the blocks are stored in an array, but since it's adding them in accordance with when they're added to the stage, it doesn't help me locate them to swap depths. Is there a way to arrange them by location on the board?

View 4 Replies

Actionscript 3 :: Select The Viewstack Container Id Based On Select Field In ComboBox In Flex?

Jun 23, 2010

I have a comboBox and values like basic and advanced. And viewstack container conatains 2 grids.When i select the base option in Combobox, the first grid has to be selected. select the advanced value in comboBox, the second grid has to be selected.

<mx:ViewStack id="viewstack1" width="95%" height="85%" x="0" y="63" >
<tables:KeyMetricsBasicTable basicArrayDataProvider="{basicArrayResult1}" width="100%" height="100%"/>
<tables:KeyMetricsAdvTable advArrayDataProvider="{advArrayResult1}" width="100%" height="100%"/>
</mx:ViewStack>

View 1 Replies

Flex :: Select All And Select None Button With In The Drop Down Of Combobox?

Dec 6, 2011

Flex 4 Combobox is extended with a Text Input that helps in getting to the item that is searched for.I have created a Check Box as an itemrenderer for this Flex 4 Combobox. I would like to Add a Select All and Select None options in the drop down of the Combobox. I know that i could accomplish by editing the dropdownfactory in case of a Flex 3 Combobox. But in Flex 4 the dropdownfactory doesnt exist.

View 2 Replies

ActionScript 2.0 :: Create A Level Select Screen So The Buttons Unlock Complete A Level?

Apr 22, 2011

im trying to create a level select screen so the buttons unlock as you complete a level, so far i have this on each button:

on(release){
if(this.number <= currentItem){
gotoAndPlay(3);
}
}

[Code]...

View 0 Replies

ActionScript 1/2 :: Buttons And Dropdown Menu - Roll Be Able To Select Anything From The Dropdown Menu?

May 7, 2009

I'm creating a webpage, and I have made some buttons.Image 1 is the homepage, which is frame 1 in Flash.Image 2 shows that when I rollover the button "Portfolio,"I get a dropdown menu.I have this set as frame 3 in Flash.Image 3 shows that I've gone down the dropdown menu and rolled over "Photography." But if I rollout of any of the things from the dropdown menu, it stays at Image 2 (Frame 3)with the dropdown menu visible. Which is a problem...I want to be able to rollout of these buttons to revert back to the homepage, Image 1 (Frame 1).But, for instance, telling "Graphic Design" to go to Frame 1 on rollout means that if I try to go below "Graphic Design" to "Photography," I've rolled out--and so the rest of the menu disappears.So I want to roll be able to select anything from the dropdown menu, and only rollout to Frame 1 if I go outside the entire dropdown menu, not just one button.

Attachments:
3.jpg
(134.5 K)

View 5 Replies

Answer To Remain On The Screen?

Sep 2, 2010

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

View 2 Replies

ActionScript 3.0 :: How To Best Keep Track Of Answer Count

Sep 17, 2010

I have a quiz created in Flex using Spark forms, with a series of questions which are a group of radio buttons. When the user clicks "next", I get the value of the selected radio button in the group. What I need to do is keep track of these values; at the end of the quiz I will need to see which value was chosen the most. So if the user mostly picked the questions with a "3" value, I can display a summary based on that, e.g. "You mostly chose type 3 answers". I was thinking about having an int variable for every choice (there are 5), and incrementing the appropriate variable when the user clicks "next", as in

private function enterScore(i:int):void {
switch (i){
case 1:
num1++;
break;

But this seems unwieldy. I also will need to compare the 5 tallies for which one was chosen the most...

View 1 Replies

ActionScript 3.0 :: Need To Play Animation On Right Answer

Sep 9, 2009

I have 2 swf animations (one of a happy bear and one of a sad bear), I want to load them into actionscript. When the player gets it wrong I want the sad animation to play and happy one to play when the player gets it right.

View 2 Replies

ActionScript 2.0 :: If Statement To Check Answer?

Jun 29, 2004

The user needs to submit a dollar amount answer. They could write is several ways. I'm trying to accomodate it with the code below. It always evaluates it as the wrong answer (the else).

[Code].....

View 4 Replies

ActionScript 3.0 :: Add Multiple Choice Answer To An Object?

Oct 18, 2009

I have declared an array which holds an object such as:

var myArr:Array = new Array({Question: 'Primary Colors Are?'});

How can I add the multiple choices to the object These are the choices:
 
red, green, blue
orange, red, white,
purple, yellow, green,
white, black, blue
 
I certainly can create the Answers as:

var myArr:Array = new Array({ Question: 'Primary Colors Are?', Answer1: 'red, green, blue',
, Answer2: 'orange, red, white, Answer3: 'purple, yellow, green', Answer4: 'white, black, blue' });

What I would like to do is to be able to store all the answer choices within an array called AnsArr. Can I declare a new array within the same obejct such as AnsArr and push these choices to it? 

View 3 Replies







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