ActionScript 2.0 :: When I Press On Answer Button, The Result Displayed Is NuN?
Aug 7, 2009
i am creating a maths quiz...There are 2 input text fields..The instance names of 2 input text fields are inputField and inputField02. There is one dynamic text field to display the result....The instance name of dynamic text field is resultField.
Code:
var a: Number;
var b: Number;[code]....
however when i press on answer button, the result displayed is NaN.What's wrong with the code?
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
look into the Fla when I press the submit button without filling the name field the error message displayed Enter Your Name, how I write the code for the combo box so that without selecting a country no body can proceed ?
I'm very new to Flash, and I'm not a programmer, I have an Input text box named txtNe2 where a user will type an answer to a question. I want to evaluate the answer when the user pushes the Enter key and respond by sending the movie to either the "Ne2C" frame or the "Ne2I" frame (for the response to the correct or incorrect answer).
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.
Frame one has three draggable movie clips and three finishing locations (one clip per location), it also has one a button (Check answer)A user can drag any of the three clips to any location and then click Check Answer.Check answer then runs an action that if the clips are in the right places, it goes to frame 2, if they are not, it goes to frame three where a Reset button is provided. In either case, a message is displayed.
On frame 3, I want people to be able to change the positions of the clips and select Check answer and have it check the answer again. Currently it's letting me move the clips, but even when I put them in the right places, it still tells me it's wrong.[code]...
I'm creating a sort of guessing game/trivia with AS 2.0. I have a popup window with a question, and four answers with a button next to each answer. The question and answers are dynamic text that are set by clicking on a "question" button.I was thinking I could do was click an answer button, which sets "current answer"... compare that with "correct answer" and do something? If it doesn't match, set the dynamic text to "wrong answer". If it's correct, then gotoAndStop(something)... I can get the answer buttons to trace their values(current answer) as I click on them, but when I try and goto () or do something based on these values (true) it seems just do whatever is in the if statement... not based on the answer being correct?Hmmm... like if I say: if (This is true)Not sure if I'm explaining this properly. But basically I have a popup window with a question. I have four answers, with buttons to select choice. I want to compare the choice/buttons pressed with a variable "correct answer" and then do something.
I'm creating a magic 8-ball for my website, just a fun little thing to play with you know. I've got an input field called "question" where you can type whatever you want, an ASK button called "ask" and a response field called "answer". Once you enter a question and hit the ASK button I want flash to randomly reply in the "answer" field with YES, NO, MAYBE, DEFINATELY etc. Do I need some kind of answers array to store all the answers and then call them at random into the "answers" field? Am I on the right track?
The code runs fine, but the problem I'm having is that the text box that is suppose to go onto of my answer buttons is behind the button itself... however, if I change two lines of code around, the answer validation code doesn't pick up the which answer was clicked (it returns undefined). This is infuriating!Look for the line "//INSERT HERE." If I take the line, "var answerField:TextField = createText(answer,answerFormat,answerSprite,0,0,450);" and put it there instead, it returns the right answers (doesn't return undefined), but I can no longer see the text. I've included the createText function as well.
private function askQuestion() { trace("asking question...");
I want the press button to detect the last button pressed and if the shapes match, make them do something...obviously. I think I'm going at it the wrong way. I need to stick a "triange" id into the button/mc then if compares that and then if there is a match works then... right?
i'm designing a website in flash8... now i have created some buttons, and i want that when i click on the button stars will fly from them and there will be a sound... i have already created the animation of the stars seperatly and it's in the library, i have also the sound file.... i just can't remember how to put everything together.... when i'll press on the button the stars will be flying from the button and the sound will play?
i have a set of buttons cranked out from and XML file. how can i emulate, in code, a press on one of those buttons? i'd like to 'press' one of them for an initial state so that the list it controls will load first off instead of waiting for the person to click it manually and THEN show the list it's connected to. thing is, the first loaded list is going to be random, so i need to 'press' what on another day/load would be a button that the user would press themselves.
in other words, i have 3 buttons. on random, i have to 'press', say button 2, to start. users can press 1 or 3 and then 2 again if they like. another time, it's button 1 that gets 'pressed' on load, etc. make sense? i have a sneaking suspicion it might be easy... or stupidly convoluted.
i have created an ios app in cs5, I am using a button when touched it should display a photo gallery. I Have researched plenty of tutorials but most of them you need to import the images onto the stage first, i only want the photos to be displayed once a button has been clicked by loading them from the library, once the photos have been loaded the user should be able to go back onto the app.
I need to make a series of 35 buttons that display an image when clicked. However, I need the previous displayed image to disappear when any other button is clicked.I have this to toggle the images on/off:[code]Any idea what I can add to the function to turn all the other buttons visibility to false when any other button is clicked?
I'm writing a flash movie that creates a few boxes displaying an image that you can flying around the screen with a sort of gravity effect eventually slowing them down. I've managed to do what I thought would be the hard part... I've made a movie clip in which theres a button (to detect the clicks and drags) which contains a graphic (a .png file). After adding some nice bits of code, I can now stick loads of instances of the movie clip on the main stage and then start flinging them round.
Now what I want to do next is change the image displayed on the button in each instance of the movie. Logically, something like : myinstanceofmovie.nameofbutton.mygraphic="name_of_ other_image.png" ...or something...
i am still new in dealing with flash and what have you posted is very useful, but i want to ask you a question regarding the button function. i want to relate a button with a certain text but it's a big paragraph so when i have made the example on the site the display in the output box is not good enough i want the text to be displayed as a paragraph not a straight line.
I have 6 button call m1-m6...ok my problem is how to disabled button when one of the button being press...and also stt.text will display crrently selected button...coz currently when I press the button it never stated and also 'stt.text ' also show nothing.
OK, say I have a button that does something, like go to the next frame, is there anyway to have it play a simple sound located in the library without looping?