ActionScript 3.0 :: Add Values From Groups Of Radio Buttons And Show The Answers?
Mar 15, 2010
I have eight groups of radio buttons. The student needs to pick on button from each group. It is a personal intrestet survey. So each of the groups will have a button with related values. I need to add the values and show the results.
how to add values from radio buttons and displaying the answers. this is what I have managed so far:
[Code]....
View 7 Replies
Similar Posts:
May 7, 2009
This one is tripping me up. I'm creating a simple 10 question 'quiz' with simple "yes" or "no" radio buttons for each question. If they picked "yes" the value is 5, while "no" is 0. I want them to be able to choose all of the answers and then click submit. On submit it would add up all the answers and save that number as a variable named "score".
I know how to setup all of the radio button groups, calling each group question1, question2, question3 etc and giving the values to each yes and no radio button. I just don't know how to capture the values on submit, add them up and save to a variable.
View 1 Replies
Mar 11, 2009
Using the Radio button component and I have 10 groups of buttons. Each group has a group name of g1, g2, etc for each yes/no button. I want to determine which button was clicked. When I run the code below I only get the first one and then each other button clicked I don't get a trace statement back.
var rbListener:Object = new Object();
rbListener.click = function(evt_obj:Object) {
trace("The selected radio button group name is "+evt_obj.target.groupName);
};
for (rb=1; rb<=10; rb++) {
_root["g"+rb].addEventListener("click",rbListener);
}
View 2 Replies
Jun 16, 2009
I have some radio buttons that are all created dynamically and range from maybe 1-4 or more. Is there a way when I click submit button I can wipe out all of those buttons?
View 1 Replies
May 24, 2004
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?
View 7 Replies
Jul 15, 2011
I am having a problem getting radio button data into php and I can not seem to find any answers. My project is simple I have a group of radio buttons, when one is selected and a submit button is pressed I want the data from the radio button to populate the subject line of an email and send it.I can make a form work with input fields but not with radio button data.
View 11 Replies
Feb 10, 2010
I've got a huge survey I've made with lots and lots of groups of radio buttons. There are maybe 60 questions with 6 buttons each. Of these, I have a couple of groups that are really misbehaving. What's happening is for one question, the first button in the group seems independent of the rest. That is, I can check the first radio button and it never turns off when clicking others in the same group.
All my code is right. I'm using the exact same code with all the other groups and only two groups aren't working right. Ha. That's the funny thing, though, because everything works fine IN Flash, but publishing to a web page, these two groups stop working right.FWIW, I've set the first instance of the radio button with a name like "G10" then all the buttons in the group have the group name "Q10".I've tried several ways of fixing this including deleting the whole group and adding them again, copying a working group and renaming the parts. Nothing. The one thing that has worked (and don't ask me why) but adding a new single radio button with a new instance and group name has fixed other problem groups but not these two.
View 7 Replies
May 20, 2009
I have this project where I have a quiz template that I am using(as2) and I have everything exactly the way I want it except.that I need for the individual questions to hold a different value from one another.
for example
Question 1 = 10 points
Question 2 = 20 points
so on and so forth
right now I have it so they are an equal percentage of the total (ie 10 questions all are worth 10 points)and I need to change thatunfortunately I am still teaching myself AS but even more unfortunate for me is that I am learning AS3 and this template is AS2 I also have not done much in this vein I have been concentrating more on UI kind of stuff and less on the math side also it makes no difference to me if this is done in AS or XML this file will not be continually updated so it can be a one time deal
View 5 Replies
Nov 8, 2011
I have a drag & drop activity where 3 of the drags can go into 1 of 3 possible dropzones and be counted as correct. On clicking 'Submit', if only some are placed correctly, there's a 'Show me' option - this is the bit I can't do:if some of those with more than 1 possible answer are correct, I don't know how to check which dropzones are free to place the remainder in. My code for the first bit, checking the hitTest is ok:
for (var i:Number = 0; i<aLabels.length; i++) {
//3 drag items have 3 poss dropzones:
for (var t:Number = 0; t<aNewCorrectDZ[i].length; t++) {
//IF ITEM IS DROPPED ON ANY DROPZONE:
[code]....
View 3 Replies
Jul 8, 2009
I'm having such trouble accessing the value of the selected radio button in a group.I put 5 radio buttons on the stage and gave them all the groupName of 'Question1' in the component inspector. They each have their own instance names and a value which is also set in the component inspector.When I go to access the group (via Test Movie) and check which value is selected I get this error:
'Access of undefined property Question1'Here's the code I'm using:
var Radio1:String = new String();Radio1 = Question1.selection.value;
SubmitBtn.addEventListener(MouseEvent.CLICK, clickHandler);
function clickHandler(eventObj:MouseEvent):void { trace("clicked"); trace(Radio1);}
Other problems I'm having with this code is the flash player doesn't believe the value of the radio object is a string...so what is the data type of the value property?
View 5 Replies
Jan 23, 2012
In my flex datagird i have a checkbox and a datgrid with seven columns. im populating values in first five column(remaining two column no values) of datgrid by an Arraycollection. now,By clicking the checkbox i want to show all seven column values and if i uncheck five columns has to show... how its possible?? heres my code
[Code]...
View 1 Replies
Oct 17, 2006
I have a survey in Flash with 5 questions. Three questions have input text boxes for the user's answers, and two have sets of radio button options. I want to send the answers to a PHP script and insert them into a MySQL database.The text boxes work fine, but the values for the radio box responses show up as "undefined" in MySQL. I'd like to know how to pass the values from the two radio button groups into the LoadVars object. The code I have is:
Code:
submit.onRelease = function(){
var questionVar:LoadVars = new LoadVars();
questionVar.question1 = question1.text;
questionVar.question2 = radioGroup1.getvalue();
[code]....
View 2 Replies
Mar 25, 2009
i am a fairly new user to flash 8 and am currently undertaking a project in creating a responsive knowledge based system in flash. i intend to give the user a set of 5 questions which they will have to answer using either a multiple or single selection of radio/checklist buttons.i am struggling in creating these buttons regarding the scripting behind it which enables the system to give the user feedback at the end.i will include 5 style of questions and depending on which ones they get correct the system will recognise this and not ask a specific type if the user is getting more of that one correct.
View 1 Replies
May 5, 2009
using flash to sell via paypal (headache)...Anyway, all is well actually but I need to use radio buttons (which I've never touched before) to populate a text field. two radio buttons, essentially a "yes/no" to populate a dynamic text field.One is on by default and will fill the field with nothing, the other, if selected, will fill the field with "no numerals".How do I do it with a listener on frame 1 of a timeline that has only one frame ?
View 1 Replies
Jun 28, 2009
I was wondering what would be the most optimal way of coding something that work this way: There's 10 buttons, you click button 5 (for example) which causes button 5 to gotoAndStop(2) while at the same time it tells all the buttons which aren't button 5 to gotoAndStop(1)
View 1 Replies
Jun 16, 2009
I created radio buttons from an XML node[code....When I click the submit button, I want to code in the listener to remove the radio buttons.I have tried using this in my submit listener
for (rd=0; rd<myQStems.length; rd++)[code]....but that doesnt delete them.
View 1 Replies
May 11, 2010
I've got 2 buttons. I need it to function like radio buttons. When one is clicked I need the other to automatically be invinsible.
if echeck_mc is visible I need echeck_mc to be invinsible. If I'm doing this wrong (marked in red) how should this be coded.
this.check_btn1.onRelease = function() { _root.glv_mc.rotate_mc1._visible = !_root.glv_mc.rotate_mc1._visible; _root.ltab_mc.echeck_mc._visible = !_root.ltab_mc.echeck_mc._visible; if (_root.ltab_mc.echeck_mc._visible = true) { _root.ltab_mc.tcheck_mc._visible = false; }};
View 3 Replies
May 12, 2011
I need to add a sign-up form for services to a flash AS2 web site.
I found a very simple example of a Flash/ PHP email form at Kirupa.
It works fine, but I need to add some radio buttons.
My web site will offer various services. Ideally I would like to be able for viewers to sign up for a service by clicking the appropriate right radio buttons
[Code]...
View 1 Replies
Mar 4, 2004
How would I be able to make this "slide" between the images, rather than just switching them with buttons? It's a landscape that changes with each click (img 2 alpha fades over image 1 on click), but it's kinda clunky. I guess I'm asking if theres a way to build a slider that controls the alphas in AS, so it can go forward And backward on slide...
View 9 Replies
Feb 28, 2003
I have made a feedback form in Flash MX with PHP. Some parts are working flawlessly. The 'input text' boxes are sending the info to my email address just fine but the radio buttons and combobox are not sending anything at all. The reason the 'input text' boxes are working is because I can give them variable names. I have no idea how to set up the combo-boxes or radio buttons.
[Code]...
View 10 Replies
Mar 9, 2010
Does anyone know the actionScript to apply to custom radio buttons? I want them to function exactly like the component radio buttons available in CS3, but I can't use those because adding one makes the .swf about 30k and I have a 30k limit on all flash files.I imagine the radio button would have to be a mC with frame 1 a drawing of a button unchecked and frame 2 the button checked. Then another mC of 4 of those radio button mC's grouped together and coding to tell it that when one is clicked to unclick the others, but I haven't been able to figure it out. I haven't been able to find any info on this online since everyone just uses the component versions anymore
View 5 Replies
Apr 26, 2009
Im trying to create a feeback (basically a fancier email form) using flash & PHP. Ive got a simple contact form which Ive always used & it works fine - but Ive never had to add radio buttons? I need this info to be sent to the client through the form,
Name
Email
Company: a or b (radios buttons I think)
Country (they want a drop down list for this)
Select: a, b,
Select: a, b, c, d
Message or comments.
View 3 Replies
Apr 22, 2009
Somebody knows if is possible to control an draggable MC with a radio button option?
I want a static movie clip turns draggable only when I set on a radio button.
View 3 Replies
May 15, 2009
I have this for loop that is basically pulling some info from an xml file and putting it in a list box. And for each item in the xml, it also adds 2 radio buttons.Everything is working properly except all the radio buttons have the same y location, and i want them to be spaced apart, not on top of each other.I have tried messing around with the y location (rb1.y+105, etc) but I'm not having any luck.
for (var i:uint=0; i<il.length(); i++) {
lb.addItem({data:il.description.text()[i],
label:il.title.text()[i]});
[code].....
View 2 Replies
Mar 22, 2010
I have a form with two radio buttons for each question. Each question is in its own frame "Q1," "Q2," etc. I also have a btn_Reset created to reset the form, i.e. reset all radio buttons and return to "Q1" frame. All buttons work as they should, including resetting the radio buttons, however, once I reset the radio buttons and return to "Q1" to start over, the actions associated with each radio button upon clicking on them do not work. Here's my code:
//Frame "Begin"
gotoAndStop("Q1") //I also define my variables in frame "Begin"
//Frame "Q1"
rbtn_YESQ1.onPress = function():Void
[Code].....
//Once I return to "Begin" frame, my variables are reset to their initial value since that's where I originally defined them, and I go to "Q1" because that's what the code in frame "Begin" says. Here is where I click on rbtn_YESQ1 again and even though the button does fill in, it does not attach btn_Reset to the stage as defined by rbtn_YESQ1.onRelease function.
View 13 Replies
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
Jul 6, 2009
In Flex, sometimes when you need to clear a form you run into the problem that radio button groups seem to defy clearing: try as you might, setting selected=false on all buttons, setting selection=null on the group, doing both, doing them twice, etc., you always seem to end up with one pesky little radio button that's still selected. How do you solve this and restore the radio button group to its initial no-selection state?
View 7 Replies
Mar 5, 2010
I have developed a Flash application for a client (wedding RSVP) and implemented it on the web. She complains that the textboxes and radio buttons disappear on IE6.
[URL]
don't submit the RSVP, as I don't want to spam my client, but just tell me if you see the radio buttons and if you can fill out the textboxes.
View 2 Replies
Apr 8, 2011
I have a list of radio buttons, which I want to be able to both set the value of programmatically and for the user to set the value of manually.I have a small list of data items which I want to display as options in a list of radio buttons. The objects are stored in a model object, as is the currently selected item. The currently selected item is bound to the radiobutton group. The radio buttons are generated using a spark list.
I am having a problem setting the list programatically - whenever I set the current value on the radiobutton group to the first value in the list, all of the radio buttons are cleared, where the first one should be selected. I when checking in the debugger, I found the likely reason - there are two radiobuttons in the group that point to the same value, one of which isn't showing. My best guess is that the list control has created an extra item renderer which it is holding on to in case it needs to scroll the list.
Is there a way to create radioButtons based on an ArrayCollection without using a list? Failing that, is it possible to prevent the list from generating the extra item?
View 2 Replies
Aug 24, 2009
In my main application I consume a web-service which gives me an array of vendors.There is a add button in the main application, which when clicked a pop-up is opened.I want to display one radio button for each vendor in this pop-up window.This is all I have done so far: 1. In the pop-up I created a radiobutton group (id = vendorGroup).2. vendorGroup has one radio button called Others (this is the default).
In the main app I call pop-up using:
private var addItemDB:addItemForm;
addItemDB = PopUpManager.createPopUp(this,addItemForm,true) as addItemForm;
[code]....
View 0 Replies